Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulien Pivotto <roidelapluie@esquimaux.be>2008-08-07 19:27:02 +0400
committerJulien Pivotto <roidelapluie@esquimaux.be>2008-08-07 19:27:02 +0400
commitd7c60041eaa1b2c912381329dc4ac2f6de1989af (patch)
treefbdb4e0950e4e4e65a13585d5f62221d13e10ca2 /src
parent949f83d1dbea32936e8359ae95ba5d5f8d0df199 (diff)
Don't print twice "ping? pong" when using /ping command in a pm.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gajim.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/gajim.py b/src/gajim.py
index 06b2e7cd2..134152b16 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -1870,7 +1870,12 @@ class Interface:
gajim.connections[account].change_status('offline','')
def handle_event_ping_sent(self, account, contact):
- for jid in [contact.jid, contact.get_full_jid()]:
+ if contact.jid == contact.get_full_jid():
+ # If contact is a groupchat user
+ jids = [contact.jid]
+ else:
+ jids = [contact.jid, contact.get_full_jid()]
+ for jid in jids:
ctrl = self.msg_win_mgr.get_control(jid, account)
if ctrl:
ctrl.print_conversation(_('Ping?'), 'status')
@@ -1878,14 +1883,23 @@ class Interface:
def handle_event_ping_reply(self, account, data):
contact = data[0]
seconds = data[1]
-
- for jid in [contact.jid, contact.get_full_jid()]:
+ if contact.jid == contact.get_full_jid():
+ # If contact is a groupchat user
+ jids = [contact.jid]
+ else:
+ jids = [contact.jid, contact.get_full_jid()]
+ for jid in jids:
ctrl = self.msg_win_mgr.get_control(jid, account)
if ctrl:
ctrl.print_conversation(_('Pong! (%s s.)') % seconds, 'status')
def handle_event_ping_error(self, account, contact):
- for jid in [contact.jid, contact.get_full_jid()]:
+ if contact.jid == contact.get_full_jid():
+ # If contact is a groupchat user
+ jids = [contact.jid]
+ else:
+ jids = [contact.jid, contact.get_full_jid()]
+ for jid in jids:
ctrl = self.msg_win_mgr.get_control(jid, account)
if ctrl:
ctrl.print_conversation(_('Error.'), 'status')