Commit 004c2b54 authored by Yann Leboulanger's avatar Yann Leboulanger

SingleMEssageWindow now shows resource of sender

parent c9ad6104
......@@ -933,7 +933,7 @@ class SingleMessageWindow:
'''SingleMessageWindow can send or show a received
singled message depending on action argument'''
def __init__(self, account, to = '', action = '', from_whom = '',
subject = '', message = ''):
subject = '', message = '', resource = ''):
self.account = account
self.action = action
......@@ -974,7 +974,10 @@ def __init__(self, account, to = '', action = '', from_whom = '',
self.subject_entry.grab_focus()
elif self.action == 'receive':
self.from_whom = from_whom
self.from_entry.set_text(self.from_whom)
fjid = from_whom # Full jid of sender (with resource)
if resource:
fjid += resource
self.from_entry.set_text(fjid)
self.from_entry.set_property('editable', False)
self.subject_entry.set_property('editable', False)
self.message_textview.set_editable(False)
......
......@@ -1701,7 +1701,7 @@ def on_message(self, jid, msg, tim, account, encrypted = False,
jid)
dialogs.SingleMessageWindow(account, contact.jid,
action = 'receive', from_whom = jid, subject = subject,
message = msg)
message = msg, resource = resource)
return
# We print if window is opened and it's not a single message
......@@ -1942,7 +1942,7 @@ def open_event(self, account, jid, event):
if typ == 'normal':
dialogs.SingleMessageWindow(account, jid,
action = 'receive', from_whom = jid, subject = data[1],
message = data[0])
message = data[0], resource = data[5])
gajim.interface.remove_first_event(account, jid, typ)
return True
elif typ == 'file-request':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment