From 91d79ee851be9fd141b25d0c6abaa512eef85124 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Tue, 19 Jul 2011 03:18:25 +0200 Subject: [PATCH 1/5] Buddylist showing also the own online status of any account --- plugin/vimchat.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 290192c..64f4aef 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -1096,7 +1096,14 @@ You can type \on to reconnect. ****************************** """ % (curJid)) continue - accountText = u"{{{ [+] %s\n"%(curJid) + accountPresenceInfo = account.jabberGetPresence() + if accountPresenceInfo[0] != None: + status = str(accountPresenceInfo[1]) + if status == "None": + status = '' + accountText = u"{{{ [+] %s\n\t%s: %s\n"%(curJid,str(accountPresenceInfo[0]),status) + else: + accountText = u"{{{ [+] %s\n"%(curJid) rF.write(accountText) roster = account._roster @@ -1125,7 +1132,7 @@ You can type \on to reconnect. if show != u'off': buddyText =\ - u"{{{ (%s) %s\n\t%s \n\tGroups: %s\n\t%s:\n%s\n}}}\n" %\ + u"{{{ (%s) %s\n\t%s \n\tGroups: %s\n\t%s: %s\n}}}\n" %\ (show, name, item, groups, show, status) rF.write(buddyText) From cad516d4e45eecc940548999d859a4c57ec38117 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Tue, 19 Jul 2011 03:29:24 +0200 Subject: [PATCH 2/5] This commit resolves a gvim SEGV on my machine. This is a fix that needs to be tested on other machines and we need to understand the main cause why those imports are not allowed in gvim --- plugin/vimchat.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 64f4aef..54af1da 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -50,7 +50,7 @@ except: pynotify_enabled = False try: - if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: + if 'DBUS_SESSION_BUS_ADDRESS' in os.environ and int(vim.eval("has('gui_running')"))==0: import pynotify pynotify_enabled = True else: @@ -69,7 +69,7 @@ except: pyotr_logging = False gtk_enabled = False -if 'DISPLAY' in os.environ: +if 'DISPLAY' in os.environ and int(vim.eval("has('gui_running')"))==0: try: from gtk import StatusIcon import gtk From e86facab1deb4767d2a5d1593b0bfe5446425b79 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Sun, 24 Jul 2011 15:26:59 +0200 Subject: [PATCH 3/5] Allow the status to be passed directly on the ex command line --- plugin/vimchat.vim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 54af1da..0216aac 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -84,8 +84,6 @@ try: growl_enabled = True except: growl_enabled = False - - #}}} #{{{ VimChatScope @@ -1054,7 +1052,6 @@ class VimChatScope: def beginChatFromBuddyList(self): account, toJid = self.getBuddyListItem('jid') [jid,user,resource] = self.getJidParts(toJid) - buf = VimChat.beginChat(account, jid) if not buf: #print "Error getting buddy info: " + jid @@ -1776,7 +1773,7 @@ com! VimChatJoinGroupChat py VimChat.openGroupChat() com! VimChatOtrVerifyBuddy py VimChat.otrVerifyBuddy() com! VimChatOtrSMPRespond py VimChat.otrSmpRespond() com! VimChatOtrGenerateKey py VimChat.otrGenerateKey() -com! -nargs=0 VimChatSetStatus py VimChat.setStatus() +com! -nargs=* VimChatSetStatus py VimChat.setStatus() com! VimChatShowStatus py VimChat.showStatus() com! VimChatJoinChatroom py VimChat.joinChatroom() autocmd! VIMLeave * :VimChatStop From 1fbdd699acf17cffc4f9f9bd386f79f8f7d6adc2 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Thu, 4 Aug 2011 00:31:20 +0200 Subject: [PATCH 4/5] Update to master --- plugin/vimchat.vim | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 28a9403..077ae96 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -51,7 +51,7 @@ except: pynotify_enabled = False try: - if 'DBUS_SESSION_BUS_ADDRESS' in os.environ and int(vim.eval("has('gui_running')"))==0: + if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: import pynotify pynotify_enabled = True else: @@ -70,7 +70,7 @@ except: pyotr_logging = False gtk_enabled = False -if 'DISPLAY' in os.environ and int(vim.eval("has('gui_running')"))==0: +if 'DISPLAY' in os.environ: try: from gtk import StatusIcon import gtk @@ -1091,14 +1091,7 @@ You can type \on to reconnect. ****************************** """ % (curJid)) continue - accountPresenceInfo = account.jabberGetPresence() - if accountPresenceInfo[0] != None: - status = str(accountPresenceInfo[1]) - if status == "None": - status = '' - accountText = u"{{{ [+] %s\n\t%s: %s\n"%(curJid,str(accountPresenceInfo[0]),status) - else: - accountText = u"{{{ [+] %s\n"%(curJid) + accountText = u"{{{ [+] %s\n"%(curJid) rF.write(accountText) roster = account._roster @@ -1127,7 +1120,7 @@ You can type \on to reconnect. if show != u'off': buddyText =\ - u"{{{ (%s) %s\n\t%s \n\tGroups: %s\n\t%s: %s\n}}}\n" %\ + u"{{{ (%s) %s\n\t%s \n\tGroups: %s\n\t%s:\n%s\n}}}\n" %\ (show, name, item, groups, show, status) rF.write(buddyText) From d5b0410033d2bd03b57a69292fe7bd17fdf08f19 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Thu, 4 Aug 2011 02:13:19 +0200 Subject: [PATCH 5/5] Allow the status to be passed directly on the ex command line --- plugin/vimchat.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 4ab3c36..b2cd801 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -1686,7 +1686,7 @@ com! VimChatJoinGroupChat py VimChat.openGroupChat() com! VimChatOtrVerifyBuddy py VimChat.otrVerifyBuddy() com! VimChatOtrSMPRespond py VimChat.otrSmpRespond() com! VimChatOtrGenerateKey py VimChat.otrGenerateKey() -com! -nargs=0 VimChatSetStatus py VimChat.setStatus() +com! -nargs=* VimChatSetStatus py VimChat.setStatus() com! VimChatShowStatus py VimChat.showStatus() com! VimChatJoinChatroom py VimChat.joinChatroom() autocmd! VIMLeave * :VimChatStop