comparison src/cagou/plugins/plugin_wid_chat.py @ 46:d6a63942d5ad

chat: fixed MUC joining following changes in backend
author Goffi <goffi@goffi.org>
date Sat, 10 Sep 2016 00:04:18 +0200
parents b0595a33465d
children abb81efef3bb
comparison
equal deleted inserted replaced
45:b0595a33465d 46:d6a63942d5ad
92 pass 92 pass
93 93
94 94
95 class Chat(quick_chat.QuickChat, cagou_widget.CagouWidget): 95 class Chat(quick_chat.QuickChat, cagou_widget.CagouWidget):
96 96
97 def __init__(self, host, target, type_=C.CHAT_ONE2ONE, occupants=None, subject=None, profiles=None): 97 def __init__(self, host, target, type_=C.CHAT_ONE2ONE, nick=None, occupants=None, subject=None, profiles=None):
98 quick_chat.QuickChat.__init__(self, host, target, type_, occupants, subject, profiles=profiles) 98 quick_chat.QuickChat.__init__(self, host, target, type_, nick, occupants, subject, profiles=profiles)
99 cagou_widget.CagouWidget.__init__(self) 99 cagou_widget.CagouWidget.__init__(self)
100 self.header_input.hint_text = u"You are talking with {}".format(target) 100 self.header_input.hint_text = u"You are talking with {}".format(target)
101 scroll_view = ScrollView(size_hint=(1,0.8), scroll_y=0, do_scroll_x=False) 101 scroll_view = ScrollView(size_hint=(1,0.8), scroll_y=0, do_scroll_x=False)
102 self.messages_widget = MessagesWidget() 102 self.messages_widget = MessagesWidget()
103 scroll_view.add_widget(self.messages_widget) 103 scroll_view.add_widget(self.messages_widget)
139 mess_type = C.MESS_TYPE_GROUPCHAT if self.type == C.CHAT_GROUP else C.MESS_TYPE_CHAT, # TODO: put this in QuickChat 139 mess_type = C.MESS_TYPE_GROUPCHAT if self.type == C.CHAT_GROUP else C.MESS_TYPE_CHAT, # TODO: put this in QuickChat
140 profile_key=self.profile 140 profile_key=self.profile
141 ) 141 )
142 input_widget.text = '' 142 input_widget.text = ''
143 143
144 def _mucJoinCb(self, bare): 144 def _mucJoinCb(self, joined_data):
145 jid_ = jid.JID(bare) 145 joined, room_jid_s, occupants, user_nick, subject, profile = joined_data
146 self.host.mucRoomJoinedHandler(*joined_data[1:])
147 jid_ = jid.JID(room_jid_s)
146 self.changeWidget(jid_) 148 self.changeWidget(jid_)
147 149
148 def _mucJoinEb(self, failure): 150 def _mucJoinEb(self, failure):
149 log.warning(u"Can't join room: {}".format(failure)) 151 log.warning(u"Can't join room: {}".format(failure))
150 152