Commit graph

2,131 commits

Author SHA1 Message Date
Goffi
a2c151f9c6 plugin XEP-0334: fixed and improved message processing hints:
- wrong elements were used in this plugging, it could not work properly
    - use constants for hints
    - add addHint method so other plugins can add a hint easily
    - hints can be added by frontends in mess_data['extra']['hints'] (serialized dict) or by other plugins using addHint
    - if history is skipped on message reception, mess_data['extra']['history']['skipped'] is set
    - introduced PLUGIN_INFO['usage'] for usage information for developers
2017-02-05 14:55:19 +01:00
Goffi
13e2e50cb0 added "send" trigger point as the last one before sending, can be used for e2e encryption 2017-02-04 17:59:15 +01:00
Goffi
6467bdb3c3 core: replaced calls to client.xmlstream.send by client.send which is the right method to use. client.xmlstream should not be used directly 2017-02-04 17:59:13 +01:00
Goffi
115f5ae0e1 plugin otr: various improvments:
- messageSend trigger now use pre_xml_treatments so it doesn't block other triggers of higher priority
    - text commands now use a very high priority, as it is local command and should not be blocked in most of cases
    - new otrState signal, to send state change to frontends
    - history is not skipped anymore, a future option may change this behaviour
    - OTR trigger are skipped on groupchat messages
    - context_manager is now in client instead of being global to plugin
    - removed fixPotr as it is fixed upstream

note triggers should be improved for encryption methods, as skipping an encrypter may break security, but putting it in top priority may break nice features.

fix bug 170
2017-02-01 21:44:24 +01:00
Goffi
10adbb04a4 core (constant): on android sat.conf is now in /data/data/org.goffi.cagou.cagou/files/platform/android/ 2017-01-31 22:35:59 +01:00
Goffi
d8b9c85cc0 core (menus): improvments:
- use the new convention for bridge names (getMenus ==> menusGet, etc.)
    - menu now use canonical path, which is the untranslated path with each element stripped and lowercase, it must be unique by menu type
    - added menuLaunch method to manually launch a menu like an action, canonical path is used instead of id
    - added SECURITY_LIMIT_MAX constant
2017-01-26 20:29:48 +01:00
Goffi
d5fbafd979 plugin sec OTR: fixed OTR:
- fixed bridge calls
    - use deferred translation
    - unicode string fixes
    - various other improvments
2017-01-26 20:24:58 +01:00
Goffi
dc4e3c9d8c quick frontend(contact list): added all_iter property to get all cached entities 2017-01-15 22:41:22 +01:00
Goffi
4eaf5d626f plugin XEP-0054, quick frontend(app): various improvments:
- memory.cache is now used
    - getAvatar and setAvatar has been renamed to avatarGet and avatarSet to follow new convention
    - getAvatar now return (optionally) full path, and may request vCard or only return avatar in cache
    - getAvatarFile has been removed as it is not needed anymore (avatarGet can return full path)
    - getCard has been removed from bridge as it was only used to request avatar
    - new internal method getBareOfFull return jid to use depending of the jid being part of a MUC or not
    - cache is now set per profile in client, instead of a general one for all profiles
    - thanks to the use of memory.cache, correct extension is now used in saved file, according to MIME type
    - fixed and better cache handling
    - a warning message is shown if given avatar hash differs from computed one
    - empty hash value is now in a constant, and ignored if received
    - QuickApp has been updated to follow new behaviour
    - Primitivus has been fixed (it was not declaring not using avatars correclty)
    - jp has been updated to follow new methods name
2017-01-15 17:51:37 +01:00
Goffi
1a33c3389f quick frontend (contact list): bare_default in getCache now default to True, plus added None:
if None is used, bare_default will be used only if the entity is not in a room
2017-01-15 16:00:41 +01:00
Goffi
41373f893c quick frontend (contact list): added isSpecial and isRoom to quickly now if an entity is specific 2017-01-15 16:00:41 +01:00
Goffi
450c9c0a15 quick frontend (contact list): fixed cached key removal 2017-01-15 16:00:40 +01:00
Goffi
e4000b4f3b jp (core): fixed signal registration for progressions 2017-01-15 16:00:40 +01:00
Goffi
6fa84527ae bridge (constructor/embedded): fixed warning on unregistered callback 2017-01-15 16:00:40 +01:00
Goffi
1db9ff572e plugin XEP-0277: fixed mbSetAccess double registration 2017-01-15 16:00:40 +01:00
Goffi
3958c9eb97 core (memory/cache): geFilePath now return None when uid is empty 2017-01-15 16:00:40 +01:00
Goffi
42f5bb6192 quick frontends (chat): send actual value instead of None on status and state updates 2017-01-09 23:10:16 +01:00
Goffi
1e09016747 jp (info/session): added a command to get data on current session 2017-01-05 22:22:26 +01:00
Goffi
50194cde01 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time 2017-01-05 22:22:13 +01:00
Goffi
fb0aaf2cae jp (constants): added exit code for error on bridge method call 2017-01-05 20:37:01 +01:00
Goffi
e744c29963 plugin text commands: added /whoami command which return current full jid 2017-01-05 20:29:19 +01:00
Goffi
d0c56aaadb plugin XEP-0231: Bits of Binary first draft:
The current implementation only retrieve data from Bits of Binary, it's not used yet for sending.
When an XHTML-IM message is received (XEP-0071), all <img> are checked and if a cid scheme is found in src attribute the file is retrieved and the src is changed with cached file.
2017-01-05 20:29:05 +01:00
Goffi
6872df4fd3 core (memory/cache): file caching handling, first draft:
instead of having file caching handled individually by plugins, a generic module has been added in memory.

    - Cache can be global or associated to a profile. In the later case, client.cache can be used.
    - Cache are managed with unique ids (which can be any unique unicode, hash uuid, or something else).
    - To know if a file is in cache, getFilePath is used: if the file is in cache, its absolute path is returned, else None is returned.
    - To cache a file, cacheData is used with at list the source of cache (most of time plugin import name), and unique id. The method return file opened in binary writing mode (so cacheData can - and should - be used with "with" statement).
    - 2 files will be created: a metadata file (named after the unique id), and the actual file.
    - each file has a end of life time, after it, the cache is invalidated and the file must be requested again.
2017-01-05 20:23:38 +01:00
Goffi
791be3a4ad core (xml_tools): fixed findAll
- names and namespases arguments haven been inverted to be in the same order as for domish.Element.elements
    - fixed bad copy of elements in recursions
    - check if childrens are IElements
    - namespaces and names can now be basestrings instead of iterables
2017-01-03 18:51:50 +01:00
Goffi
66e393336b frontends(tools/strings): put URL regex outside of getURLParams and precompile it 2017-01-01 16:39:26 +01:00
Goffi
46ced6d74e plugin text syntaxes: log error on cleanXHTML failure 2017-01-01 16:38:32 +01:00
Goffi
a37b57e7ad core(constants): added a constant for profile extension (PLUGIN_EXT):
this constant may be modified if needed, which is the case on Android (it's modified by Cagou service's main.py), so platform detection is not needed anymore in sat_main.py.
2016-12-25 16:43:56 +01:00
Goffi
fa136a4998 misc: README update 2016-12-24 14:08:21 +01:00
Goffi
6307c89618 quick frontend (quick app): added progressFinished and progressError listeners 2016-12-22 18:10:36 +01:00
Goffi
9fff6e1343 quick frontend (quick app): fixed use of profile_manager.connected 2016-12-20 21:07:22 +01:00
Goffi
f237685c1a Primitivus (xmlui): use constants for BOOL_TRUE and BOOL_FALSE value 2016-12-20 21:06:42 +01:00
Goffi
6782bb9a3b plugin android: first draft:
- the plugin cancel its own import if it's not launched on Android platform
    - this plugin show a notification when a non MUC message is received when Cagou is not active
    - the device also optionally vibrate on notification
2016-12-19 23:49:37 +01:00
Goffi
32036a4044 plugin XEP-0280: Message Carbons first draft 2016-12-18 20:21:31 +01:00
Goffi
0a5fd6f3f4 primitivus, jp: dynamic bridge + fixed D-Bus bridge:
Primitivus and jp can now load the bridge specified in sat.conf, but they are only working with D-Bus so far (need to change all sync calls to async).
    Exit code 3 is used for Bridge init error.
2016-12-18 16:28:51 +01:00
Goffi
be8d681be7 quick_frontend(QuickApp): added onBridgeConnected method 2016-12-18 16:28:46 +01:00
Goffi
1b7290aa70 core (memory/disco): recover getItems on bridge's discoItems method if an item is empty 2016-12-18 16:28:44 +01:00
Goffi
ced2c16721 xep-0184: delivery receipts are now activated by default 2016-12-18 10:17:32 +01:00
Goffi
9a9ac75b20 xep-0070: fixed use of byte string instead of unicode 2016-12-18 10:16:47 +01:00
Goffi
5768160d2d frontends(xmlui): better handling of missing _xmluiAppend 2016-12-18 10:15:57 +01:00
Goffi
90440303ea bridbe(pb): Perspective Broker bridge, first draft 2016-12-13 22:27:49 +01:00
Goffi
34cec8fe14 bridge, quick_frontend: preparation for async bridge
bridge can currently have sync and async methods. This commit prepare the transition to fully async bridges:
    - a new bridgeConnect method must be called to prepare the bridge
    - quick app, quick profile manager: changed sync calls to async ones
    - quick app: bridgeConnect can be called automatically or manually depending on connect_bridge parameter of QuickApp
2016-12-13 22:27:48 +01:00
Goffi
58795c675c core(stdui/profile manager): fixed authentication cancellation 2016-12-04 21:35:23 +01:00
Goffi
2618d48e7b core, quick_frontends: android compatibility hacks:
a couple of hacks have been used so backend can be launched on android using kivy
    - config file (sat.conf) is been read on a specific dir, using a detection of Cagou domains in constants.py
    - fixed crash when using sys.stdout.isatty in log_config.py
    - Q&D fix for logging encoding issue on android
    - when android is detected, the path/pattern to load plugins is modified
    - SRV is not working at the moment on android. If the platform is detected, the host is used directly with default port. A hosts_dir configuration can be used in [android] section to map a specific ip to a host
    - getRepositoryData in tools/utils return constant string on android. Proper repository data need to be copied during package building.
    - [quick app] more robust failure handling on asyncConnect error
    - [quick chat] default to utf-8 when getlocale doesn't return the actual locale.
2016-12-04 18:16:48 +01:00
Goffi
9ce91cf534 core: bridge can now be changed in conf
by default DBus bridge is used, but this can be changed in sat.conf's DEFAULT section using "bridge" option.
    bridge can be "dbus" (or equivalent "dbus_bridge") or embedded at the moment.
    Bridge name used is saved in SAT.bridge_name, and load_bridge method can be used by frontends.
2016-12-04 18:16:37 +01:00
Goffi
6ad826bb0d bridge (constructor): embedded bridge generator:
"embedded" is used to have backend and frontend together in the same process (frontend call backend as a module).
2016-10-05 22:07:51 +02:00
Goffi
372f54ec2a bridge (D-Bus): bad design fixes:
- renamed outputed module to dbus_bridge (to avoid uppercase and conflict with dbus module)
    - class name is now Bridge for both frontend and core (make discovery/import more easy)
    - register renamed to register_method in core, and register_signal in frontend
2016-10-03 21:15:39 +02:00
Goffi
fc04d33fac bridge (constructor): refactoring:
- constructors are now in separate modules
    - constructors are discovered dynamically
    - factorised generation code from D-Bus in base Constructor.
    - A generic generation method is now available in base Constructor, using python formatting.
    - removed bridge/bridge.py in core as it was useless, may come back in the future if needed
2016-10-02 22:44:33 +02:00
Goffi
df1b19bd66 bridge(constructor): constructor now uses argparse instead of optparse 2016-10-02 15:56:20 +02:00
Goffi
001834b760 bridge(D-Bus): minotr argument name fix 2016-10-02 15:51:42 +02:00
Goffi
95f77b1df1 quick frontend(contact_list): avoid crash when resource in cache has not priority 2016-10-02 13:46:29 +02:00