always reply to incoming resource. see #5227
This commit is contained in:
parent
bad4297952
commit
377a777823
3 changed files with 13 additions and 2 deletions
|
@ -1199,7 +1199,7 @@ class Connection(ConnectionHandlers):
|
||||||
msgenc = ''
|
msgenc = ''
|
||||||
|
|
||||||
if session:
|
if session:
|
||||||
fjid = str(session.jid)
|
fjid = session.get_to()
|
||||||
|
|
||||||
if keyID and self.USE_GPG:
|
if keyID and self.USE_GPG:
|
||||||
xhtml = None
|
xhtml = None
|
||||||
|
|
|
@ -54,6 +54,7 @@ class StanzaSession(object):
|
||||||
self.conn = conn
|
self.conn = conn
|
||||||
self.jid = jid
|
self.jid = jid
|
||||||
self.type = type_
|
self.type = type_
|
||||||
|
self.resource = None
|
||||||
|
|
||||||
if thread_id:
|
if thread_id:
|
||||||
self.received_thread_id = True
|
self.received_thread_id = True
|
||||||
|
@ -75,6 +76,12 @@ class StanzaSession(object):
|
||||||
def is_loggable(self):
|
def is_loggable(self):
|
||||||
return self.loggable and gajim.config.should_log(self.conn.name, self.jid)
|
return self.loggable and gajim.config.should_log(self.conn.name, self.jid)
|
||||||
|
|
||||||
|
def get_to(self):
|
||||||
|
to = str(self.jid)
|
||||||
|
if self.resource:
|
||||||
|
to += '/' + self.resource
|
||||||
|
return to
|
||||||
|
|
||||||
def remove_events(self, types):
|
def remove_events(self, types):
|
||||||
'''
|
'''
|
||||||
Remove events associated with this session from the queue.
|
Remove events associated with this session from the queue.
|
||||||
|
@ -107,7 +114,7 @@ class StanzaSession(object):
|
||||||
if self.thread_id:
|
if self.thread_id:
|
||||||
msg.NT.thread = self.thread_id
|
msg.NT.thread = self.thread_id
|
||||||
|
|
||||||
msg.setAttr('to', self.jid)
|
msg.setAttr('to', self.get_to())
|
||||||
self.conn.send_stanza(msg)
|
self.conn.send_stanza(msg)
|
||||||
|
|
||||||
if isinstance(msg, xmpp.Message):
|
if isinstance(msg, xmpp.Message):
|
||||||
|
|
|
@ -86,6 +86,10 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
|
||||||
'''dispatch a received <message> stanza'''
|
'''dispatch a received <message> stanza'''
|
||||||
msg_type = msg.getType()
|
msg_type = msg.getType()
|
||||||
subject = msg.getSubject()
|
subject = msg.getSubject()
|
||||||
|
if self.jid != full_jid_with_resource:
|
||||||
|
self.resource = gajim.get_nick_from_fjid(full_jid_with_resource)
|
||||||
|
if self.control:
|
||||||
|
self.control.resource = self.resource
|
||||||
|
|
||||||
if not msg_type or msg_type not in ('chat', 'groupchat', 'error'):
|
if not msg_type or msg_type not in ('chat', 'groupchat', 'error'):
|
||||||
msg_type = 'normal'
|
msg_type = 'normal'
|
||||||
|
|
Loading…
Add table
Reference in a new issue