Commit graph

2,926 commits

Author SHA1 Message Date
Goffi
cad0d4b0e2 core (memory): raise PermissionError directly instead of using failureFailure, as it could not be catched correctly in every case. 2019-04-28 08:55:13 +02:00
Goffi
74bc166b88 plugin XEP-0384: wait for client to be ready if session is missing when onNewDevices is called 2019-04-28 08:55:07 +02:00
Goffi
a46dda1e12 memory: minor style change 2019-04-26 11:57:26 +02:00
Goffi
bcba2ab9ae plugin XEP-0329: use local part of jid for components:
when used by a component, local part can now be used to specify owner of the file. Local part is escaped using XEP-0106, then:
- if the unescaped text contain a "@", it is used as a jid
- else, a jid is build by using this text and host of the component
2019-04-26 11:57:26 +02:00
Goffi
ae686b6368 plugin XEP-0106: jid escaping implementation 2019-04-26 11:57:26 +02:00
Goffi
007575d62b plugin XEP-0050: make plugin usable with components + new adHocError method to easily raise error when needed 2019-04-26 11:57:26 +02:00
Goffi
75fc5d3453 plugin XEP-0166: fixed missing key in warning log 2019-04-26 11:57:26 +02:00
Goffi
98098105e7 memory (sqlite): minor log improvment 2019-04-26 11:57:26 +02:00
Goffi
621c6b3ffa memory (sqlite): fixed fileUpdate when original value is not set (NULL) 2019-04-26 11:57:26 +02:00
Goffi
fae128d8fe plugin invitation file: wrong plugin had been uploaded:
this patch remove the test pluging erroneously uploaded, and add the right one instead
2019-04-26 11:57:26 +02:00
Goffi
97563c3f25 jp (file/share): added invite command to invite an entity to a file sharing repository 2019-04-14 08:21:51 +02:00
Goffi
c3fcfb3d64 core: fixed component connexion:
presence announcement has been moved to startConnection, but component don't have presence. This patch fixes it by moving presence announcement to clients only.
2019-04-14 08:21:51 +02:00
Goffi
553ebe5ab8 core: added getNamespace method to retrieve a namespace from short name. 2019-04-14 08:21:51 +02:00
Goffi
ab861ef91c plugins sharing invitation, invitation, list of interest: handle invitation to a file sharing repository 2019-04-14 08:21:51 +02:00
Goffi
29b2a7cb11 plugin events: refactored invitation and personal lists logic:
- invitation logic has been moved to a new generic "plugin_exp_invitation" plugin
- plugin_misc_invitations has be rename "plugin_exp_email_invitation" to avoid confusion
- personal event list has be refactored to use a new experimental "list of interest", which regroup all interestings items, events or other ones
2019-04-14 08:21:51 +02:00
Goffi
1ccb54e571 tools (sat_defer), plugin XEP-0060: added a function "stanza2NotFound" to convert item-not-found StanzaError to exceptions.NotFound in an errback 2019-04-14 08:21:51 +02:00
Goffi
d85f1b364f jp, plugin merge-requests: used u'' as default for item id in pubsub arguments + fixed some required arguments:
u"" is now used as defaut item id instead of node, as it needs to be serialised anyway. This is temporary solution, as empty string can be used for item id (not forbidden by XEP-0060), but for now this is not handled correctly in jp/SàT (see https://bugs.goffi.org/bugs/view/289). Correct solution will probably need to use a special key in extra to mark empty string in id.
Added/removed some required values for node or item when it made sense.
2019-04-14 08:21:51 +02:00
Goffi
5e2426c065 core (memory), plugin XEP-0329, plugin invitation: minor style improvments 2019-04-14 08:21:51 +02:00
Goffi
6b83ef5c51 plugins: removed useless execute permission 2019-04-14 08:21:51 +02:00
Goffi
bc061ee885 template (filters): set locale when using "date_fmt" 2019-04-14 08:21:51 +02:00
Goffi
e1ff10bf77 template (i18n): activate ext.i18n.trimmed policy, to have clean translation strings. Set minimal jinja2 version to 2.10 2019-04-14 08:21:51 +02:00
Goffi
5dda9f6857 jp (common): publish is now a boolean 2019-04-10 22:15:29 +02:00
Goffi
4a0d1701fc primitivus (chat): fixed crash when removing focus_marker after a :search or :history command 2019-04-10 21:07:47 +02:00
Goffi
4ab939c46a template: added "locales" variables to templates:
"locales" contains an ordered tuple of locales of all available translations. This can be used by templates to diplay language/locale menu.
2019-04-10 21:04:51 +02:00
Goffi
1f7d5bfd94 constants: added KEY_LANG which is the key/name used in templates to change language/locale. 2019-04-10 21:04:51 +02:00
Goffi
4d64efcda9 code (xmpp): store version after roster item update + fix item removal:
roster version is now stored after roster item has been added or removed. This way if something interrupting the process happens, former item update will be received and roster should be updated correctly.

Roster item removal was crashing because `load()` is not used (local PersistentDict cache is then not updated, and the key to remove is missing there). The exception is now catched and ignored to avoid loading the data only to remove an item.
2019-04-10 21:04:41 +02:00
Goffi
29bb633914 primitivus: don't call chatStateComposing when host is out of sync:
if host is out of sync, that means that server is not connected and it makes no sense to call this method. Furthermore, this was resulting in a crash because profile is not found.
2019-04-07 21:09:51 +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
4701027950 memory (sqlite): cast timestamp_start filter to float instead of int 2019-04-07 20:57:13 +02:00
Goffi
5a90f9d407 core, quick_frontend(app): fixed connected signal handling 2019-04-07 20:55:27 +02:00
Goffi
8c6be44375 jp (roster): added resync command to do a full roster resynchronisation 2019-04-07 18:50:13 +02:00
Goffi
f51e924eb6 core: added a rosterResync method to bridge:
rosterResync do a full resynchronisation of roster with server. This should not be needed, but may be useful if user suspect a sync issue for whatever reason.
2019-04-07 18:49:41 +02:00
Goffi
5ceffc1491 core (xmpp): implemented roster versioning 2019-04-07 18:47:17 +02:00
Goffi
8adba38036 core (memory/persistent): added clear method + initialise with a dict:
A "clear" method has been added to delete all data for a specific namespace (and profile).
Internal cache (self._cache) is not initialised with an empty dict instead of None to allow using methods like __setitem__ or clear without having to do a potentially expansive `load()` before. The only counterpart is that we won't have an exception anymore if developer forget to load() data before using them, which can make debugging a bit more difficult.
2019-04-07 18:44:57 +02:00
Goffi
aac5e58ec6 core (memory/sqlite): display arguments in logs in case of too many db/interaction tries 2019-04-07 18:38:18 +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
30bf1362bb plugin android: check connectivity
use Android API to retrieve connectivity informations (connection availability + kind of connection).
Register to connectivity change broadcast, new client.networkEnabled/client.networkDisabled are called when suitable.
2019-04-06 19:05:58 +02:00
Goffi
c2c7dbddfe core (xmpp): new networkEnabled() and networkDisabled() methods:
those methods can be called by platform specific plugins when network is known to be (un)available. This way, connection attempts can be cancelled when no network is available, saving resources (notably battery on mobile devices), or attempts can be restarted immediately when network is known to be available again.
2019-04-06 19:05:57 +02:00
Goffi
5b3aa5c60f core (xmpp): advanced handling of connection termination
factory's clientConnectionFailed and clientConnectionLost methods are monkey patched to allow client to tune termination:
    - a warning when connection is lost in an unclean way
    - connector is saved to allow to disable automatic reconnection and retry manually later
    - new triggers connection_failed and connection_lost allow plugins to tune connection termination workflow
2019-04-06 18:51:20 +02:00
Goffi
9186fd1a3c core (xmpp): use the cleaner stopTrying() instead of setting continueTrying = 0 when connection is not possible due to invalid certificate. 2019-04-05 21:22:05 +02:00
Goffi
2f4651d22b jp (avatar/get): fixed avatar being displayed 2 times in a corner case:
when avatar is shown by ImageMagick's display and it is terminated using SIGINT, the return code is 2 and not 0.
Before this patch, jp was interpreting the 2 as an image not displayed and so was trying with the next available command
Now it is stopping when exit code 2 is received.
2019-04-05 21:22:05 +02:00
Goffi
7faaa9691b plugin android: fixed csi_timer reset in setActive + crash on call of isActive before session initialisation 2019-04-05 21:22:03 +02:00
Goffi
47bd1495df primitivus (chat): use the factorised code for user moved info messages. 2019-03-28 08:40:38 +01: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
1a958d8744 core: minor style improvments 2019-03-27 21:15:25 +01:00
Goffi
8f702a5d07 plugin text syntaxes: activated useful markdown extensions:
- code can now be highlighted, fenced code block can be used.
- new lines are converted to hard breaks
- sane lists are used
- tables are available
2019-03-25 18:40:12 +01:00
Goffi
c83ac61e1d tools (common/template): always use highlight.css if present. 2019-03-25 18:40:11 +01:00