Fixed resource extraction from jid. Fixes #5310
This commit is contained in:
parent
3ef8557a8e
commit
90c653b83a
2 changed files with 5 additions and 5 deletions
|
@ -212,10 +212,10 @@ def get_server_from_jid(jid):
|
||||||
pos = jid.find('@') + 1 # after @
|
pos = jid.find('@') + 1 # after @
|
||||||
return jid[pos:]
|
return jid[pos:]
|
||||||
|
|
||||||
def get_nick_from_fjid(jid):
|
def get_resource_from_jid(jid):
|
||||||
# fake jid is the jid for a contact in a room
|
tokens = jid.split('/', 1)
|
||||||
# gaim@conference.jabber.no/nick/nick-continued
|
if len(tokens) > 1:
|
||||||
return jid.split('/', 1)[1]
|
return tokens[1]
|
||||||
|
|
||||||
def get_name_and_server_from_jid(jid):
|
def get_name_and_server_from_jid(jid):
|
||||||
name = get_nick_from_jid(jid)
|
name = get_nick_from_jid(jid)
|
||||||
|
|
|
@ -86,7 +86,7 @@ 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()
|
||||||
resource = gajim.get_nick_from_fjid(full_jid_with_resource)
|
resource = gajim.get_resource_from_jid(full_jid_with_resource)
|
||||||
if self.resource != resource:
|
if self.resource != resource:
|
||||||
self.resource = resource
|
self.resource = resource
|
||||||
if self.control and self.control.resource:
|
if self.control and self.control.resource:
|
||||||
|
|
Loading…
Add table
Reference in a new issue