plugin XEP-0045, primitivus: added MUC configuration
This commit is contained in:
parent
3fdca75224
commit
72fd99f679
1 changed files with 63 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ from urwid_satext.files_management import FileDialog
|
|||
from sat_frontends.quick_frontend.quick_chat import QuickChat
|
||||
from sat_frontends.primitivus.card_game import CardGame
|
||||
from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate
|
||||
from sat_frontends.primitivus.xmlui import XMLUI
|
||||
import time
|
||||
from sat.tools.jid import JID
|
||||
|
||||
|
|
@ -131,7 +132,9 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
menu = sat_widgets.Menu(self.host.loop)
|
||||
if self.type == 'group':
|
||||
game = _("Game")
|
||||
muc = _("MUC")
|
||||
menu.addMenu(game, "Tarot", self.onTarotRequest)
|
||||
menu.addMenu(muc, _("Configure room"), self.onConfigureRoom)
|
||||
elif self.type == 'one2one':
|
||||
menu.addMenu(_("Action"), _("Send file"), self.onSendFileRequest)
|
||||
return menu
|
||||
|
|
@ -335,6 +338,13 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
else:
|
||||
self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile)
|
||||
|
||||
def onConfigureRoom(self, menu):
|
||||
def gotUI(xmlui):
|
||||
self.host.addWindow(XMLUI(self.host, xmlui))
|
||||
def configureError(failure):
|
||||
self.host.showPopUp(sat_widgets.Alert(_("Error"), unicode(failure), ok_cb=self.host.removePopUp))
|
||||
self.host.bridge.configureRoom(self.id, self.host.profile, callback=gotUI, errback=configureError)
|
||||
|
||||
def onSendFileRequest(self, menu):
|
||||
dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp)
|
||||
self.host.showPopUp(dialog, 80, 80)
|
||||
|
|
|
|||
Loading…
Reference in a new issue