disable pm chats when we leave a room. Fixes #2036
This commit is contained in:
parent
fec491607f
commit
ea2a906e31
1 changed files with 10 additions and 2 deletions
|
@ -119,6 +119,13 @@ class PrivateChatControl(ChatControl):
|
||||||
return
|
return
|
||||||
|
|
||||||
ChatControl.send_message(self, message)
|
ChatControl.send_message(self, message)
|
||||||
|
|
||||||
|
def update_ui(self):
|
||||||
|
if self.contact.show == 'offline':
|
||||||
|
self.got_disconnected()
|
||||||
|
else:
|
||||||
|
self.got_connected()
|
||||||
|
ChatControl.update_ui(self)
|
||||||
|
|
||||||
|
|
||||||
class GroupchatControl(ChatControlBase):
|
class GroupchatControl(ChatControlBase):
|
||||||
|
@ -289,7 +296,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.handlers[id] = self.msg_textview
|
self.handlers[id] = self.msg_textview
|
||||||
# set an empty subject to show the room_jid
|
# set an empty subject to show the room_jid
|
||||||
self.set_subject('')
|
self.set_subject('')
|
||||||
self.got_disconnected() #init some variables
|
self.got_disconnected() # init some variables
|
||||||
|
|
||||||
self.update_ui()
|
self.update_ui()
|
||||||
self.conv_textview.tv.grab_focus()
|
self.conv_textview.tv.grab_focus()
|
||||||
|
@ -1030,7 +1037,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
message_array = message_array[0].split()
|
message_array = message_array[0].split()
|
||||||
nick = message_array.pop(0)
|
nick = message_array.pop(0)
|
||||||
room_nicks = gajim.contacts.get_nick_list(self.account, self.room_jid)
|
room_nicks = gajim.contacts.get_nick_list(self.account,
|
||||||
|
self.room_jid)
|
||||||
if nick in room_nicks:
|
if nick in room_nicks:
|
||||||
privmsg = ' '.join(message_array)
|
privmsg = ' '.join(message_array)
|
||||||
self.on_send_pm(nick=nick, msg=privmsg)
|
self.on_send_pm(nick=nick, msg=privmsg)
|
||||||
|
|
Loading…
Add table
Reference in a new issue