Commit graph

2,886 commits

Author SHA1 Message Date
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
Goffi
6ec0f5a506 jp (blog/set): fixed use of --item argument 2019-03-25 18:40:10 +01:00
Goffi
655416f115 misc (CHANGELOG): added CSI 2019-03-25 18:40:08 +01:00
Goffi
08650b3037 misc (setup): minimum markdown version is not 3.0 2019-03-25 08:46:09 +01:00
Goffi
fbb5442ff8 plugin text syntaxes: disable raw HTML parsing in mardown by default 2019-03-25 08:14:00 +01:00
Goffi
598f4e465e plugin android: use XEP-0352 to indicate (in)active state:
Client State Indication plugin is used to set state when pause/resume is called.
The state is changed on pause only after a delay (currently 30s), to avoid changing state if use is only checking something quickly on an other app.
2019-03-25 07:08:26 +01:00
Goffi
d637c4cc0e plugin XEP-0352: implementation of Client State Indication 2019-03-25 07:08:23 +01:00
Goffi
db06965385 jp (blog/edit): fixed handling of XHTML content when it is not already wrapped in <div>…</div> 2019-03-25 07:06:48 +01:00
Goffi
d4efb6dad1 plugin text syntaxes: fixed default syntax 2019-03-25 07:06:48 +01:00
Goffi
d58fbe6170 plugin android: workaround to seek() bug, fixing file upload:
seek() is bugged on current version of P4A, arguments are inverted.
More details can be found at https://github.com/kivy/python-for-android/issues/1768
2019-03-25 07:06:41 +01:00
Goffi
3c41ade548 plugin upload: minor fixes in some docstring length 2019-03-22 19:26:09 +01:00
Goffi
9335194f7b plugin XEP-0363: updated to namespace "urn:xmpp:http:upload:0", handle headers 2019-03-22 19:26:08 +01:00
Goffi
430649f58f plugin XEP-0198: reset req_timer on session.reset():
req_timer may not have been called when session.reset() is called (e.g. on resuming failed after computer has been suspended), so reset() must cancel it and set its value to None.
2019-03-21 08:54:59 +01:00
Goffi
833cfb25bb quick frontend(chat): fixed updateHistory bad call to historyPrint 2019-03-20 19:33:38 +01:00
Goffi
985bc5efb7 plugin upload: fixed inversion of title and message body + better error message on failed upload 2019-03-20 09:08:47 +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
0fbde67f2a plugin XEP-0384: handle NoEligibleDevicesException 2019-03-20 09:08:47 +01:00
Goffi
e89135b8ae plugin XEP-0384: give feedback to client when encryption failed 2019-03-20 09:08:47 +01:00
Goffi
71144d4581 plugin XEP-0384: small refactoring to encrypt messages + bugfix:
encryptMessage is now called in a loop, because problems may happen by steps (e.g. trust issue after getting missing bundles).
Fixed a mix between "if" and "elif" in problems handling,
2019-03-20 09:08:47 +01:00
Goffi
ace2f57027 plugin XEP-0384: removed version restriction, it is now compatible with (and require) last version of python-omemo (0.10.4) 2019-03-20 09:08:37 +01:00
Goffi
8ce1861529 plugin android: don't send notification if message comes from ourself (from an other device) 2019-03-16 14:39:02 +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
89aa5e4079 plugin XEP-0045: added getRoomOccupants/mucOccupantsGet method to retrieve occupants of a joined room. 2019-03-09 16:24:17 +01:00
Goffi
8830a7c1d5 core (memory/sqlite): added a "timestamp_start" filter to retrieve history from a specific point in time 2019-03-09 16:24:15 +01:00
Goffi
d8eae5a05e plugin text commands: typo 2019-03-09 16:23:07 +01:00
Goffi
248d771176 plugin android: improved state handling:
state handling is not using mmap anymore but an unix socket instead.
State change can now be managed.
Bridge signals are disabled when frontend is paused.
2019-03-09 16:23:01 +01:00
Goffi
a9311c530f bridge (pb): added bridgeDeactivateSignals and bridgeReactivateSignals methods:
those methods stop and restart signals propagation, they are used on mobile OS when the frontend is paused.
2019-03-09 16:23:00 +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
8e70237d20 plugin XEP-0077: correctly report invalid certificate + errback on unexpected stream close 2019-03-03 19:18:45 +01:00
Goffi
6d7e6185ff plugin manhole: added "jid" module to globals 2019-03-03 17:17:07 +01:00