@@ -145,6 +145,7 @@ class VimChatScope:
145
145
name = chatrooms[jid][' name' ]
146
146
for room in chatrooms[jid][' rooms' ]:
147
147
#time.sleep (2 )
148
+ print " Joining chat room " + room + " ..."
148
149
self ._openGroupChat (self .accounts[jid], room, name)
149
150
else :
150
151
self .toggleBuddyList ()
@@ -187,7 +188,7 @@ class VimChatScope:
187
188
else :
188
189
return False
189
190
#}}}
190
- #{{{ inject_message
191
+ #{{{ inject_message
191
192
def inject_message (self , opdata= None, accountname= None, protocol= None, recipient= None, message= None):
192
193
if accountname in VimChat.accounts.keys ():
193
194
if recipient and message:
@@ -807,14 +808,6 @@ class VimChatScope:
807
808
return buf
808
809
return None
809
810
#}}}
810
- #{{{ moveCursorToBufBottom
811
- def moveCursorToBufBottom (self , buf ):
812
- return
813
- # Update the cursor .
814
- for w in vim .windows:
815
- if w .buffer == buf :
816
- w .cursor = (len (buf ), 0 )
817
- #}}}
818
811
#{{{ isGroupChat
819
812
def isGroupChat (self ):
820
813
try :
@@ -1074,16 +1067,16 @@ class VimChatScope:
1074
1067
1075
1068
buf .append (line )
1076
1069
#TODO : remove these lines
1077
- #line = line .replace (" '" , " z " )
1070
+ #line = line .replace (" '" , " '' " )
1078
1071
#vim .command (" call append(line('$'),'" + line + " ')" )
1079
- #vim .command (" let @m = '" + line .replace (" '" , " z" ) + " '" )
1080
- #vim .command (' put m' )
1081
1072
if not secure or pyotr_logging:
1082
1073
VimChat.log (account, logJid, line )
1083
1074
1084
1075
for line in lines :
1085
1076
line = ' \t' + line
1086
1077
buf .append (line )
1078
+ #line = line .replace (" '" , " ''" )
1079
+ #vim .command (" call append(line('$'),'" + line + " ')" )
1087
1080
#if message is not secure , or if otr logging is on
1088
1081
if not secure or pyotr_logging:
1089
1082
VimChat.log (account, logJid, line )
@@ -1164,6 +1157,13 @@ class VimChatScope:
1164
1157
vim .command (' sbuffer ' + str (buf .number ))
1165
1158
account.jabberJoinGroupChat (chatroom, name)
1166
1159
#}}}
1160
+ #{{{ moveCursorToBufBottom
1161
+ def moveCursorToBufBottom (self , buf ):
1162
+ return
1163
+ for w in vim .windows:
1164
+ if w .buffer == buf :
1165
+ w .cursor = (len (buf ), 0 )
1166
+ #}}}
1167
1167
1168
1168
#ACCOUNT
1169
1169
#{{{ showAccountList
@@ -1356,7 +1356,9 @@ class VimChatScope:
1356
1356
def notify (self , jid, msg, groupChat):
1357
1357
# Important to keep this print statement . As a side effect, it
1358
1358
# refreshes the buffer so the new message shows up .
1359
- print " Message Received from: " + jid
1359
+ # TODO : try replacing print with echo so :messages doesn't get polluted
1360
+ vim .command (" echo 'Message Received from: " + jid.replace (" '" , " ''" )
1361
+ + " '" )
1360
1362
1361
1363
if groupChat:
1362
1364
myNames = map (lambda x : x .split (' @' )[0 ], self .accounts.keys ())
0 commit comments