Mercurial > libervia-backend
comparison frontends/quick_frontend/quick_chat.py @ 72:f271fff3a713
MUC implementation: first draft
/!\ the experimental muc branche of wokkel must be used
- bridge: new roomJoined signal
- wix: contact list widget is now in a separate file, and manage different kinds of presentation
- wix: chat window now manage group chat (first draft, not working yet)
- wix: constants are now in a separate class, so then can be accessible from everywhere
- wix: new menu to join room (do nothing yet, except entering in a test room)
- new plugin for xep 0045 (MUC), use wokkel experimental MUC branch
- plugins: the profile is now given for get_handler, cause it can be used internally by a plugin (e.g.: xep-0045 plugin)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Mar 2010 10:28:55 +1100 |
parents | 8f2ed279784b |
children | db0a0f000e37 |
comparison
equal
deleted
inserted
replaced
71:efe81b61673c | 72:f271fff3a713 |
---|---|
24 | 24 |
25 | 25 |
26 | 26 |
27 class QuickChat(): | 27 class QuickChat(): |
28 | 28 |
29 def __init__(self, to_jid, host): | 29 def __init__(self, target, host, type='one2one'): |
30 self.to_jid = to_jid | 30 self.target = target |
31 self.host = host | 31 self.host = host |
32 self.type = type | |
33 | |
34 def setType(self, type): | |
35 """Set the type of the chat | |
36 @param type: can be 'one2one' for single conversation or 'group' for chat à la IRC | |
37 """ | |
38 self.type = type | |
32 | 39 |
33 def historyPrint(self, size=20, keep_last=False, profile='@NONE@'): | 40 def historyPrint(self, size=20, keep_last=False, profile='@NONE@'): |
34 """Print the initial history""" | 41 """Print the initial history""" |
35 debug (_("now we print history")) | 42 debug (_("now we print history")) |
36 history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.to_jid, 20) | 43 history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.target, 20) |
37 stamps=history.keys() | 44 stamps=history.keys() |
38 stamps.sort() | 45 stamps.sort() |
39 for stamp in stamps: | 46 for stamp in stamps: |
40 self.printMessage(JID(history[stamp][0]), history[stamp][1], profile, stamp) | 47 self.printMessage(JID(history[stamp][0]), history[stamp][1], profile, stamp) |
41 if keep_last: ##FIXME hack for sortilege | 48 if keep_last: ##FIXME hack for sortilege |