summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-02-24 01:38:51 +0100
committermathieui <mathieui@mathieui.net>2012-02-24 01:38:51 +0100
commitce1c6e4ec6fa2585e1f9bbc620fb8510dd3b0303 (patch)
tree421c7b3d75bb59838d5b8aa0a57969452a2d86b0 /src/core.py
parentae6fa61b843d76a084897e9e55f95736b76b4900 (diff)
downloadpoezio-ce1c6e4ec6fa2585e1f9bbc620fb8510dd3b0303.tar.gz
poezio-ce1c6e4ec6fa2585e1f9bbc620fb8510dd3b0303.tar.bz2
poezio-ce1c6e4ec6fa2585e1f9bbc620fb8510dd3b0303.tar.xz
poezio-ce1c6e4ec6fa2585e1f9bbc620fb8510dd3b0303.zip
Fixes #2333
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 5b7bf3af..79dce53a 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1219,11 +1219,14 @@ class Core(object):
if not tab:
return None
new_tab = tabs.PrivateTab(complete_jid, tab.own_nick)
+ if hasattr(tab, 'directed_presence'):
+ new_tab.directed_presence = tab.directed_presence
if not focus:
new_tab.state = "private"
# insert it in the tabs
self.add_tab(new_tab, focus)
self.refresh_window()
+ tab.privates.append(new_tab)
return new_tab
def on_groupchat_subject(self, message):
@@ -1352,6 +1355,8 @@ class Core(object):
for tab in self.tabs:
if isinstance(tab, tabs.MucTab) and tab.joined:
muc.change_show(self.xmpp, tab.name, tab.own_nick, show, msg)
+ if hasattr(tab, 'directed_presence'):
+ del tab.directed_presence
self.set_status(show, msg)
if isinstance(current, tabs.MucTab) and current.joined and show not in ('away', 'xa'):
current.send_chat_state('active')
@@ -1395,6 +1400,21 @@ class Core(object):
import traceback
self.information(_('Could not send directed presence'), 'Error')
log.debug(_("Could not send directed presence:\n") + traceback.format_exc())
+ tab = self.get_tab_by_name(jid)
+ if tab:
+ if type in ('xa', 'away'):
+ tab.directed_presence = False
+ chatstate = 'inactive'
+ else:
+ tab.directed_presence = True
+ chatstate = 'active'
+ if tab == self.current_tab():
+ tab.send_chat_state(chatstate, True)
+ if isinstance(tab, tabs.MucTab):
+ for private in tab.privates:
+ private.directed_presence = tab.directed_presence
+ if self.current_tab() in tab.privates:
+ self.current_tab().send_chat_state(chatstate, True)
def completion_status(self, the_input):
"""