From 91d79ee851be9fd141b25d0c6abaa512eef85124 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Tue, 19 Jul 2011 03:18:25 +0200 Subject: [PATCH 1/6] 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/6] 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 82a336750f59bef92d827e3dd85d2252d4b90203 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Tue, 26 Jul 2011 21:00:31 +0200 Subject: [PATCH 3/6] Check for libnotify improved/revised --- plugin/vimchat.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 64f4aef..0cb4d87 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -129,9 +129,7 @@ class VimChatScope: #Libnotify libnotify = int(vim.eval('g:vimchat_libnotify')) - if libnotify == 1 and pynotify_enabled: - pynotify_enabled = True - else: + if not libnotify: pynotify_enabled = False #Growl Setup From 1fbdd699acf17cffc4f9f9bd386f79f8f7d6adc2 Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Thu, 4 Aug 2011 00:31:20 +0200 Subject: [PATCH 4/6] 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 a560f7b915be4d90588abc372c7138477a72847a Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Thu, 4 Aug 2011 00:48:09 +0200 Subject: [PATCH 5/6] Buddylist showing also the own online status of any account --- plugin/vimchat.vim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 077ae96..130660b 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -1091,7 +1091,15 @@ 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 @@ -1120,8 +1128,8 @@ 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" %\ - (show, name, item, groups, show, status) + u"{{{ (%s) %s\n\t%s \n\tGroups: %s\n\t%s: %s\n}}}\n" %\ + (show, name, item, groups, show, status) rF.write(buddyText) rF.write("}}}\n") @@ -1529,8 +1537,8 @@ You can type \on to reconnect. def setStatus(self, status=None): if not status: status = str( - vim.eval('input("Status: (away,xa,dnd,chat),message,\ - priority: ")')) + vim.eval('input("Status: (away,xa,dnd,chat),message,'+ + 'priority: ")')) parts = status.split(',') show = parts[0] From e2c984fc8c21b8955c7aa4ba8a4683abba799f3d Mon Sep 17 00:00:00 2001 From: Philipp Schmidt Date: Thu, 4 Aug 2011 00:58:15 +0200 Subject: [PATCH 6/6] Buddylist showing presence, indentation fixed --- plugin/vimchat.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/vimchat.vim b/plugin/vimchat.vim index 130660b..d889b89 100644 --- a/plugin/vimchat.vim +++ b/plugin/vimchat.vim @@ -1538,7 +1538,7 @@ You can type \on to reconnect. if not status: status = str( vim.eval('input("Status: (away,xa,dnd,chat),message,'+ - 'priority: ")')) + 'priority: ")')) parts = status.split(',') show = parts[0]