Commit graph libervia-backend/sat_frontends/quick_frontend
Author SHA1 Message Date
Goffi
36f87054d1 quick frontends (app): setSpecial is now called before getOrCreateWidget in mucRoomJoinedHandler:
this avoid a issue in Primitivus where the contact list selection is done
before the room is actually added to the contact list.
2019-07-14 21:19:47 +02:00
Goffi
31a9e2bd09 quick frontend (chat), primitivus(chat): properly clear occupants on resync:
occupants widgets were not cleared in Primitivus on resync while occupants dictionary was, resulting in nicknames sometimes apearing doubled in Primitivus MUC rooms.

A new occupantsClear method has been added in QuickChat, so it can be overriden by frontends to clear widgets or other representations of occupants.

fix 304
2019-07-06 12:22:25 +02:00
Goffi
fa50789710 quick_frontend (contact list): fixed nick use for groupchat:
during the profile connection workflow, joined rooms are retrieved, then presence are
filled, all asynchronously. In some cases, all rooms may not be joined when presence are
filled, resulting in cache being already filled with a `nick` when cache is set for the
room itself. Because of that, a `nick` may be displayed in contact list instead of MUC local
part. This patch fixes it by removing `nick` if it exists when cache a MUC room.

fix 305
2019-07-05 15:58:15 +02:00
Goffi
1250f1a8ac quick frontends (contact list): ignore roster entities with a resource:
cache uses bare entities, as a result when a jid with a resource is used in roster, it is not handled properly.
As this case is rare and probably resulting from bugs in clients, entities with resources are ignored and a warning is logged when this happens.

fix 306
2019-06-30 15:52:27 +02:00
Goffi
e14e69c883 quick frontends (app, chat): disabled the 2 most verbose logs, as they are barely useful and make reading logs difficult. 2019-06-30 15:41:59 +02:00
Goffi
fc41d45039 quick frontend (app): (un)set sync state on (dis)connect:
when connected signal is received, a whole (re)connection has happened, meaning that everything is potentially out of sync (opened widget and contact lists), so host.sync is set accordingly.
It's a temporary option, as (dis)connect is a per-profile signal, and host.sync is global. Methods similar to sync workflow must be implemented on a per-profile basis.
2019-04-07 21:09:49 +02:00
Goffi
9f147f1c36 quick frontend (app): added debug logs on sync state change + refill contact lists on resync when AUTO_RESYNC is set 2019-04-07 21:06:57 +02:00
Goffi
a9fc7c9650 quick frontend (contact list): fixed profile filtering in fill() 2019-04-07 20:59:34 +02:00
Goffi
f0c567d949 quick_frontend (app): fixed filters serialisation before calling bridge.historyGet 2019-04-07 20:58:15 +02:00
Goffi
5a90f9d407 core, quick_frontend(app): fixed connected signal handling 2019-04-07 20:55:27 +02:00
Goffi
34207a8969 quick_frontend (widgets): fixed crash on getWidgets when target doesn't correspond to any widget 2019-04-07 15:04:28 +02:00
Goffi
a28d1d136a quick frontend(chat): prepared factorisation of merging of user moved info messages:
- new MessageWidget class, to have a common ancestor for widgets from different frontends
- new message_widgets_rev property to get reverse iterator on message widgets
- new isUserMoved method to check if a Message is a user moved info
- new handleUserMoved method to merge info message when suitable. This is code from Primitivus made generic.
2019-03-28 08:39:19 +01:00
Goffi
833cfb25bb quick frontend(chat): fixed updateHistory bad call to historyPrint 2019-03-20 19:33:38 +01:00
Goffi
1b312477b1 quick_frontend (app): progress callbacks handling:
in addition to listeners, a frontend can now register progression callback and errback which are called when the given progressing action is finished.
Those callbacks can be registered using registerProgressCbs or specified in actionManager.
2019-03-20 09:08:47 +01:00
Goffi
e1e00f4d86 quick frontend (app): fixed notifications ids 2019-03-20 09:08:47 +01:00
Goffi
4ca9acadf9 quick frontend(widgets): added QuickWidget.target property as a helper method to get a single target:
a single target is the most common case, but QuickWidget handle multiple targets. When a single target is requested and multiple exist, a random one is returned.
This is a temporary situation, targetting should be improved in a future version to manage multiple targets in hash.
2019-03-10 18:04:27 +01:00
Goffi
3eeeb8040c core: added a "_debug" signal:
this signal is a generic debugging signal which can be implemented in frontends to do specific actions, like printing data dumps.
2019-03-10 18:04:01 +01:00
Goffi
da54c69eaa quick frontend (widgets): improved deletion of widget:
QuickWidget deletion has been improved a bit. A new "all_instances" kwarg can be used to completely delete all instances of a widget.
2019-03-10 18:03:41 +01:00
Goffi
7cf0180731 quick frontend(widgets): improved handling of multiple instances of widgets:
when a widget was recreated, a new hash was created with a suffix, making hash matching difficult and bug prone.
This has been changed to use a list of instances instead, this simplify the code and avoid issues while looking for existing instances of a widget.
2019-03-10 18:03:14 +01:00
Goffi
4c8f108192 quick_frontend (widget, chat): implementation of new sync mechanism, first draft:
QuickWidget implement base of sync mechanism with a sync property which can be overriden, and resync method which is called when resynchronisation is needed.
When resync is required, chat widget get missing occupant and history elements
A new callable argument can be used with historyPrint, when set it is called when history has been fully printed.
2019-03-10 18:03:11 +01:00
Goffi
060c985aba quick frontend (chat): new updateOccupants methods which add/remove occupants to be in sync with new list 2019-03-10 18:03:02 +01:00
Goffi
a89c506722 quick frontend(chat): added setLocked/setUnlocked methods:
those methods replace manual change of self._locked and manual creation/handling of caching.
2019-03-10 18:02:58 +01:00
Goffi
93ac4db950 quick_frontend(app): fixed use of bare jid for target when getting a new message:
in newMessage handler, full jid was sometime used for target, while is should always be bare jid. Full jid is used in the messageNew method of each widget.
2019-03-10 18:02:56 +01:00
Goffi
3830c1c176 quick frontend(chat): display a useful message with __unicode__ and __str__ 2019-03-10 18:02:54 +01:00
Goffi
465d9ad62e quick frontend (app): added AUTO_RESYNC attribute in QuickApp, when set (default) the resync method is called on all widgets automatically:
if AUTO_RESYNC is False, frontend must call itself the resync method.
This is useful to improve performance, resynchronising all widgets at once may be resource intensive, and it may be more efficient to resync a widget only when it is visible.
2019-03-10 18:02:42 +01:00
Goffi
fe4a6abfae quick frontend (app): new synchronisation mechanism:
on some frontend (notably on mobiles) frontend can be paused and lose synchronisation with backend, this can also happen if backend restart a connexion without resuming using stream management. To manage that, QuickApp now has a sync attribute which is True when the backend is in sync with frontend.
When synchronisation has been lost and is possible again, all widget will have their "resync" method called, which can be used to do necessary calls to update the status.
It's the responsability of each widget to then reset the "sync" attribute, once everything has been resynchronised.
2019-03-09 16:33:31 +01:00
Goffi
38783d2c1b quick frontend(chat): use bare jid for getEncryptionState, and skip if for group chat 2019-03-03 20:59:29 +01:00
Goffi
3f1412f677 quick frontend(app): avoid sending empty messages 2019-03-01 17:42:28 +01:00
Goffi
472a43597e primitivus(contact list): fixed room not always appearing correctly in contact list 2019-03-01 17:33:15 +01:00
Goffi
512ae0b91e plugin XEP-0277: blog items data are now entirely serialised before going to bridge:
So far, and for historical reasons, blog items data where serialised using a unicode: unicode dict, which was causing trouble for many types of values (timestamps, booleans, lists).
This patch changes it by serialising the whole items before going to bridge, and deserialising it when going back. This way, complex data can be used easily in items.
This impact psEvent and serItemsData* methods which are renamed transItemsData* because there are not always serialising anymore (a new argument "serialise" allows to specify it).
When editing a blog post in jp, metadata are now more easy to manipulate, specially lists like tags.
2019-02-23 18:59:00 +01:00
Goffi
687ef5b6bd quick frontend (chat): use right type in getOrCreateWidget on new message 2019-01-22 18:52:16 +01:00
Goffi
c16292b2b5 quick frontends: visible_widgets can now keep any kind of widget, new visible_quick_widgets only iters on QuickWidgets 2019-01-20 15:46:32 +01:00
Goffi
2396f623aa quick frontend (app): fixed filtering for chat state notifications 2019-01-19 23:27:59 +01:00
Goffi
db6a38c4fb quick frontend (chat): fixed use of old method printInfo 2019-01-19 23:27:22 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
7a9ee35cfc misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext) 2019-01-11 11:13:15 +01:00
Goffi
c2a1ba3793 core (xmpp): don't send message without message or subject to bridge (and log a warning in frontends if such a message is received) 2019-01-02 18:28:30 +01:00
Goffi
575b5dd126 quick frontend(chat): use unicode on jid.JID instance in self.host.bridge.messageEncryptionGet:
jid.JID is causing trouble when going trough bridge (with pb bridge), this patch avoid it by using unicode.
2018-12-27 11:40:04 +01:00
Goffi
867f58cd4e quick frontend (contact list): use property to retrieve "whoami" in ProfileContactList:
this avoid a crash introduced by early creation of contact list during profile plugging, and avoid desynchronisation risk.
2018-11-09 16:17:45 +01:00
Goffi
154ba0d349 quick frontend (app): create the contact list immediatly on plug
This avoid crash when contact list is used while connexion is not done yet or not possible (e.g. server unavailable).
2018-11-05 09:13:05 +01:00
Goffi
5d6321ec9f frontends (xmlui): class_map is now an arg of create function:
class_map was so far used as a global value, but in some cases, several XMLUI managers may be used (it's the case in Cagou's remote controllers plugins, template_xmlui is used to manage remotes).
This patch set class_map as a create argument, this way it can be set with partial, and several XMLUI managers can be instanced at the same time.
2018-08-31 16:03:12 +02:00
Goffi
1cb7461f99 quick frontend (app, chat): encryption handling:
- new QuickApp.ENCRYPTION_HANDLERS class attribute, if True (default), encryption handlers are set
- encryption plugins are retrieved on startup and cached in QuickApp.encryption_plugins list
- QuickChat's encrypted boolean attribute indicate if a session is currently encrypted. This is updated
  automatically if ENCRYPTION_HANDLERS is set
- if ENCRYPTION_HANDLERS is set, messageEncryptionStarted and messageEncryptionStopped are called when
  suitable.
2018-08-11 18:24:55 +02:00
Goffi
c1defc005d quick_frontend (chat): create target in cache if it is not found, avoiding an exception 2018-07-02 08:54:57 +02:00
Goffi
1a74cdce28 quick_frontend (QuickApp): fixed getCache handling after changes in QuickContactList 2018-06-27 22:50:32 +02:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
cf0d3af803 quick app: added missing docstring in showDialog 2018-06-26 07:09:49 +02:00
Goffi
519451bd84 quick_frontend(contact list): refactored update:
update is now called with appropriate constant value (C.UPDATE_ADD, C.UPDATE_DELETE, C.UPDATE_MODIFY and so on) when a widget change visibility according to current options.
Before it was linked to cache only (C.UPDATE_ADD was only called when contact was first added to cache).
This make widget handling in frontends more easy.

Renamed entityToShow to entityVisible, which seems to correspond better.

Started reducing lines lenght to 90 chars as a test. May become the new coding style soon.
2018-06-24 21:59:29 +02:00
Goffi
212b4fe88a quick frontends (app): retrieve namespaces on startup 2018-05-22 10:07:33 +02:00
Goffi
a6956d424a quick frontend (app): avoid resource locking on new message 2018-05-11 20:06:06 +02:00
Goffi
bc83869090 quick frontend (contact list): don't store "nick" for group contacts:
plugin XEP-0054 may associate a "nick" with a bare jid, which in case of MUC can cause trouble (Primitivus for instance will use the nick instead of the name of the room).
This hack avoid this issue for now.
2018-05-11 17:13:58 +02:00