Skip to content

Commit 17fbbcd

Browse files
author
naveedm9
committed
In the notify method, changed the print statement to an echo so :messages
don't get polluted. git-svn-id: http://vimchat.googlecode.com/svn/trunk@127 d1d492a2-f496-11dd-9d1d-173cc1d06e3c
1 parent 6c72b8d commit 17fbbcd

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

plugin/vimchat.vim

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class VimChatScope:
145145
name = chatrooms[jid]['name']
146146
for room in chatrooms[jid]['rooms']:
147147
#time.sleep(2)
148+
print "Joining chat room " + room + "..."
148149
self._openGroupChat(self.accounts[jid], room, name)
149150
else:
150151
self.toggleBuddyList()
@@ -187,7 +188,7 @@ class VimChatScope:
187188
else:
188189
return False
189190
#}}}
190-
#{{{ inject_message
191+
#{{{ inject_message
191192
def inject_message(self, opdata=None, accountname=None, protocol=None, recipient=None, message=None):
192193
if accountname in VimChat.accounts.keys():
193194
if recipient and message:
@@ -807,14 +808,6 @@ class VimChatScope:
807808
return buf
808809
return None
809810
#}}}
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-
#}}}
818811
#{{{ isGroupChat
819812
def isGroupChat(self):
820813
try:
@@ -1074,16 +1067,16 @@ class VimChatScope:
10741067

10751068
buf.append(line)
10761069
#TODO: remove these lines
1077-
#line = line.replace("'", "z")
1070+
#line = line.replace("'", "''")
10781071
#vim.command("call append(line('$'),'" + line + "')")
1079-
#vim.command("let @m = '" + line.replace("'", "z") + "'")
1080-
#vim.command('put m')
10811072
if not secure or pyotr_logging:
10821073
VimChat.log(account, logJid, line)
10831074

10841075
for line in lines:
10851076
line = '\t' + line
10861077
buf.append(line)
1078+
#line = line.replace("'", "''")
1079+
#vim.command("call append(line('$'),'" + line + "')")
10871080
#if message is not secure, or if otr logging is on
10881081
if not secure or pyotr_logging:
10891082
VimChat.log(account, logJid, line)
@@ -1164,6 +1157,13 @@ class VimChatScope:
11641157
vim.command('sbuffer ' + str(buf.number))
11651158
account.jabberJoinGroupChat(chatroom, name)
11661159
#}}}
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+
#}}}
11671167

11681168
#ACCOUNT
11691169
#{{{ showAccountList
@@ -1356,7 +1356,9 @@ class VimChatScope:
13561356
def notify(self, jid, msg, groupChat):
13571357
# Important to keep this print statement. As a side effect, it
13581358
# 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+
+ "'")
13601362

13611363
if groupChat:
13621364
myNames = map(lambda x: x.split('@')[0], self.accounts.keys())

0 commit comments

Comments
 (0)