plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass):
- bridge methods/signals now all start with "muc" to follow new convention
- internal method use client instead of profile to follow new convention
- removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added
- cleaned/simplified several part of the code. checkClient removed as it is not needed anymore
- self.clients map removed, muc data are now stored directly in client
- getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane.
/!\ This break all room game plugins for the moment
- use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
This commit is contained in:
parent
a28bb7be8f
commit
04515e5013
2 changed files with 296 additions and 309 deletions
|
|
@ -30,6 +30,7 @@ from sat_frontends.primitivus.constants import Const as C
|
|||
from sat_frontends.primitivus.keys import action_key_map as a_key
|
||||
from sat_frontends.primitivus.widget import PrimitivusWidget
|
||||
import time
|
||||
import locale
|
||||
from sat_frontends.tools import jid
|
||||
from functools import total_ordering
|
||||
import bisect
|
||||
|
|
@ -117,8 +118,8 @@ class MessageWidget(urwid.WidgetWrap):
|
|||
# timestamp
|
||||
if self.parent.show_timestamp:
|
||||
# if the message was sent before today, we print the full date
|
||||
time_format = "%c" if self.timestamp < self.parent.day_change else "%H:%M"
|
||||
markup.append(('date', "[{}]".format(time.strftime(time_format, self.timestamp).decode('utf-8'))))
|
||||
time_format = u"%c" if self.timestamp < self.parent.day_change else u"%H:%M"
|
||||
markup.append(('date', u"[{}]".format(time.strftime(time_format, self.timestamp).decode(locale.getlocale()[1]))))
|
||||
|
||||
# nickname
|
||||
if self.parent.show_short_nick:
|
||||
|
|
|
|||
|
|
@ -855,7 +855,7 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
|
||||
def onJoinRoomRequest(self, menu):
|
||||
"""User wants to join a MUC room"""
|
||||
pop_up_widget = sat_widgets.InputDialog(_("Entering a MUC room"), _("Please enter MUC's JID"), default_txt=self.bridge.getDefaultMUC(), ok_cb=self.onJoinRoom)
|
||||
pop_up_widget = sat_widgets.InputDialog(_("Entering a MUC room"), _("Please enter MUC's JID"), default_txt=self.bridge.mucGetDefaultService(), ok_cb=self.onJoinRoom)
|
||||
pop_up_widget.setCallback('cancel', lambda dummy: self.removePopUp(pop_up_widget))
|
||||
self.showPopUp(pop_up_widget)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue