Commit graph libervia-backend/sat_frontends/quick_frontend
Author SHA1 Message Date
Goffi
e1a44cf4e4 fixed shebangs 2020-01-29 10:07:00 +01:00
Goffi
a39349fe64 dates update 2020-01-29 09:50:54 +01:00
Goffi
af4320dfbe quick frontend (app): log own jid when received 2020-01-27 19:53:31 +01:00
Goffi
9dc875550c quick frontend (app): call getReady once connected to bridge:
namespaces and encryption plugins are only retrieved once backend is ready, else they may
not yet be available (can happen notably when the backend is start at the same time as the
frontend, e.g. on Android).
2020-01-25 21:08:26 +01:00
Goffi
eca0f773cf quick frontend (widgets): don't use *args for onDelete + more debug logs 2020-01-17 20:27:35 +01:00
Goffi
d9e1ba8ce1 quick frontend (widgets): some more errors handling in getOrCreateWidget 2020-01-17 18:47:02 +01:00
Goffi
6bff1bdc33 quick frontend (widgets): fixed widget creation in getOrCreateWidget:
when a new widget was created, it was overwritting the exiting instances list. This patch
fixes it.
2020-01-17 17:55:57 +01:00
Goffi
6a18650a99 quick frontend (app): removed workaround for pyjamas 2020-01-17 15:27:39 +01:00
Goffi
f1372b6b94 quick frontend (widgets): added "widget_hash" helper property 2020-01-17 15:26:44 +01:00
Goffi
ced601a824 quick_frontend (widget): typo 2020-01-03 20:10:58 +01:00
Goffi
7dd0df7f41 core, bridge: encryptionPluginsGet now returns a serialised list + added "directed" in metadata 2019-12-30 20:44:04 +01:00
Goffi
efe52d755d plugin XEP-0045: added room statuses to metadata:
room statuses are now sent with other metadata on bridge signals, and saved in Room
instance. They give useful data on the room, for instance they can be used to know if a
full jid is used in this room.
2019-12-30 20:44:02 +01:00
Goffi
6bf470ea9f quick frontend(chat): store filters used with initial historyGet 2019-11-18 22:34:13 +01:00
Goffi
4f4c4448ee quick frontend(app): catch exception when trying to remove a missing listener, and log it 2019-11-18 22:34:13 +01:00
Goffi
adf7621495 quick frontend (chat): removed hack not needed anymore now that Pyjamas is not used anymore 2019-11-08 11:56:21 +01:00
Goffi
fb2dc9b7a0 quick frontend (contact list): added "contactsFilled" event 2019-10-29 20:24:29 +01:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
cf83f04af4 quick frontend (app): show an info log if avatar is not found instead of raising exception
fix 288
2019-07-20 16:03:28 +02:00
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