Mercurial > libervia-web
comparison src/browser/sat_browser/chat.py @ 872:fa29524774d6
browser (chat): use new style bridge call for mucLeave
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 29 Feb 2016 12:40:17 +0100 |
parents | 2491898b3041 |
children | e8b133b77aa4 |
comparison
equal
deleted
inserted
replaced
871:54f6c5b86a87 | 872:fa29524774d6 |
---|---|
23 # from sat_frontends.tools.games import SYMBOLS | 23 # from sat_frontends.tools.games import SYMBOLS |
24 from sat_browser import strings | 24 from sat_browser import strings |
25 from sat_frontends.tools import jid | 25 from sat_frontends.tools import jid |
26 from sat_frontends.quick_frontend import quick_widgets, quick_games, quick_menus | 26 from sat_frontends.quick_frontend import quick_widgets, quick_games, quick_menus |
27 from sat_frontends.quick_frontend.quick_chat import QuickChat | 27 from sat_frontends.quick_frontend.quick_chat import QuickChat |
28 from sat.core.i18n import _ | |
29 | 28 |
30 from pyjamas.ui.AbsolutePanel import AbsolutePanel | 29 from pyjamas.ui.AbsolutePanel import AbsolutePanel |
31 from pyjamas.ui.VerticalPanel import VerticalPanel | 30 from pyjamas.ui.VerticalPanel import VerticalPanel |
32 from pyjamas.ui.HorizontalPanel import HorizontalPanel | 31 from pyjamas.ui.HorizontalPanel import HorizontalPanel |
33 from pyjamas.ui.Label import Label | 32 from pyjamas.ui.Label import Label |
103 self.presenceListener = self.onPresenceUpdate | 102 self.presenceListener = self.onPresenceUpdate |
104 self.host.addListener('presence', self.presenceListener, [C.PROF_KEY_NONE]) | 103 self.host.addListener('presence', self.presenceListener, [C.PROF_KEY_NONE]) |
105 self.avatarListener = self.onAvatarUpdate | 104 self.avatarListener = self.onAvatarUpdate |
106 host.addListener('avatar', self.avatarListener, [C.PROF_KEY_NONE]) | 105 host.addListener('avatar', self.avatarListener, [C.PROF_KEY_NONE]) |
107 Window.addWindowResizeListener(self) | 106 Window.addWindowResizeListener(self) |
108 | 107 |
109 self._body.add(chat_area) | 108 self._body.add(chat_area) |
110 self.content = AbsolutePanel() | 109 self.content = AbsolutePanel() |
111 self.content.setStyleName('chatContent') | 110 self.content.setStyleName('chatContent') |
112 self.content_scroll = base_panel.ScrollPanelWrapper(self.content) | 111 self.content_scroll = base_panel.ScrollPanelWrapper(self.content) |
113 chat_area.add(self.content_scroll) | 112 chat_area.add(self.content_scroll) |
199 | 198 |
200 def onQuit(self): | 199 def onQuit(self): |
201 libervia_widget.LiberviaWidget.onQuit(self) | 200 libervia_widget.LiberviaWidget.onQuit(self) |
202 if self.type == C.CHAT_GROUP: | 201 if self.type == C.CHAT_GROUP: |
203 self.host.removeListener('presence', self.presenceListener) | 202 self.host.removeListener('presence', self.presenceListener) |
204 self.host.bridge.call('mucLeave', None, unicode(self.target.bare)) | 203 self.host.bridge.mucLeave(self.target.bare, profile=C.PROF_KEY_NONE) |
205 | 204 |
206 def newMessage(self, from_jid, target, msg, type_, extra, profile): | 205 def newMessage(self, from_jid, target, msg, type_, extra, profile): |
207 header_info = extra.pop('header_info', None) | 206 header_info = extra.pop('header_info', None) |
208 if header_info: | 207 if header_info: |
209 self.setHeaderInfo(header_info) | 208 self.setHeaderInfo(header_info) |