Commit graph

2,172 commits

Author SHA1 Message Date
Goffi
d1ba64c780 core, plugin XEP-0077: in-band registration fix and move:
in-band was partially in core for historical reason, it has been moved to XEP-0077, and fixed. It is still incomplete, but should work for basic accounts creation.
2017-03-08 20:59:31 +01:00
Goffi
6378718ddc primitivus: fixed profileCreate bridge call 2017-03-08 20:44:28 +01:00
Goffi
0257809292 i18n: updated sat.po 2017-03-06 21:22:59 +01:00
Goffi
a4934b1955 tools(templates): workflow improvments:
- template theme can be specified in parenthesis: (some_theme)path/to/template.html. Withtout parenthesis, "default" is used
    - static content are supposed to be in [theme]/static, error pages in [theme]/error/[err_code].html
    - default page are used in some case (2 for now): if error page with specified code doesn't exists, a base page is used, and if a page doesn't exist for a theme, the same one for default theme is looked for
    - CSS files are automatically found for HTML pages
    - CSS files can be split, the'll be added in the template according to the page requested.
    - theme CSS file is looked for, and if not found the default theme equivalent is looked for.
    - each element of a path can be associated to a CSS file, and styles.css is always there. For instance if blog/articles.html is requested, the following CSS can be included: "styles.css", "blog.css", "blog_article.css". They all must be in /static
    - if the automatic finding of CSS files is not wanted, css_files arguments can be used instead, with full relative path (i.e. including theme)
    - CSS files can be merged and included inline with css_inline argument
    - root_path can be specified, it will be used as a prefix for static files
    - requested theme (which may differ from actual theme, e.g. if the template is not found and default one is used instead) is available in template with "theme" variable
    - added getThemeAndRoot method to retrieve theme and theme root path from template
2017-03-05 23:41:10 +01:00
Goffi
085ed041e7 core, bridge: renamed getProfileName to profileNameGet according to new conventions 2017-03-05 21:36:01 +01:00
Goffi
9b0542fb46 core, frontends: various fixes for Libervia:
- quick_app: don't fail when we can't get autodisconnect parameter
    - bridge: removed useless BridgeFrontend parent class
    - use of TypeError, unicode and list to workaround Pyjamas incompatibilities
2017-02-26 18:23:01 +01:00
Goffi
27f5dd80bf core (memory/cache): escape profile when creating cache dir 2017-02-26 18:20:27 +01:00
Goffi
4a36fba066 tools (common): fixed tty detection when isatty is not available 2017-02-23 07:33:30 +01:00
Goffi
a1def7f8f0 jp (blog): set default template and data mapping for the new template output 2017-02-21 21:01:40 +01:00
Goffi
8579722d09 jp (output): template output first draft:
template output use the new template renderer and data_objects module in backend tools.
    Options can be specified: template to give a direct path to template, browser to display result directly, inline-css to include css in the HTML page.
    Default template can be specified in command's TEMPLATE attribute, and a template_data_mapping method is called if it exists to map data to what is expected by the template.
2017-02-21 21:01:40 +01:00
Goffi
c4c57e7d42 jp (base): improved module import:
module import now display a warning were suitable on import issue
2017-02-21 21:01:40 +01:00
Goffi
8155bc3ee8 jp (base, blog, output(std)): fixed bad unicode handling in stdout, use of jp.disp instead of simple print 2017-02-21 21:01:40 +01:00
Goffi
8d578cec3b core (tools/common): data objects first draft:
this module aims is to help manipulate complex data from bridge, mainly for the template system.
    It is in common and not only in frontends as it may be used in some case by backend, if it needs to use template system in the future.
2017-02-21 21:01:40 +01:00
Goffi
23cb2e5843 core (tools/common): template renderer first draft:
jinja integration is being rewritten to be used not only in Libervia, this is a first step which put the renderer in backend/frontends tools.
    The renderer is mainly HTML oriented, but may be used for other files.
    sat_templates dependency is needed to use it.
2017-02-21 21:01:39 +01:00
Goffi
bc8c6d34ca jp (blog/get): fancy output prints author, published and updated if verbosity > 1 and tags if verbosity > 2 + format published and updated 2017-02-17 00:33:55 +01:00
Goffi
bb6d71d857 jp (blog): added blog/get command:
- blog/get will retrieve and parse blog items on specified service/node and can request only one or more specific items according to ids of max value
    - it takes profit of outputs and the new extra_outputs: a default output display microblogs as key/value, a fancy one display it in a more confortable way for reading it the terminal
    - for default output, keys can be filtered using --key argument
2017-02-16 01:02:33 +01:00
Goffi
97cf0e6e01 jp (outputs): added OUTPUT_COMPLEX type for data which are more complex than key/value dictionaries 2017-02-16 00:51:33 +01:00
Goffi
127744dd5b jp (core): added extra_outputs:
- extra outputs are output locals to a command which can be used in addition to the generic one which are compatible
    - added --output_option argument(s) to specify option specific to selected output
    - Jp.command now references the running command
2017-02-16 00:49:46 +01:00
Goffi
bc5f57702f core (constants), tools (common/ansi): moved ANSI escape codes to a dedicated class, with helper methods 2017-02-16 00:44:54 +01:00
Goffi
84fd46d62c tools (common/data_format): added dict2iterdict to yield dictionary from serialised complex values 2017-02-16 00:40:50 +01:00
Goffi
9608829d3b plugins XEP-0033, XEP-0280, text commands: fixed method renaming after client refactoring 2017-02-13 20:59:09 +01:00
Goffi
3e795fde5c jp (info/disco): added --node argument 2017-02-12 21:17:56 +01:00
Goffi
0a2a18ebaf core(memory.disco), bridge: discoInfos and discoItems now handle node 2017-02-12 21:17:56 +01:00
Goffi
749bd76f62 plugin XEP-0045: fix after client refactoring 2017-02-12 21:17:56 +01:00
Goffi
3bc851abf2 core (memory/disco): getInfos now handle node + use client instead of profile in many methods 2017-02-12 20:43:20 +01:00
Goffi
a205ff4e90 core: added release name in constants + full version 2017-02-12 19:23:34 +01:00
Goffi
85f3bd5988 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
- profilesGetList now handles clients and components boolean arguments, to filter profiles
    - jp: added --clients and --components options to profile/list
    - profilesGetList now returns sorted profiles
2017-02-12 19:08:52 +01:00
Goffi
ac7d587c49 core (plugins): added missing contants + use of new constants in PLUGIN_INFO 2017-02-12 18:59:10 +01:00
Goffi
97337202cb core, jp: component handling + client handling refactoring:
- SàT can now handle components
    - plugin have now a "modes" key in PLUGIN_INFO where they declare if they can be used with clients and or components. They default to be client only.
    - components are really similar to clients, but with some changes in behaviour:
        * component has "entry point", which is a special plugin with a componentStart method, which is called just after component is connected
        * trigger end with a different suffixes (e.g. profileConnected vs profileConnectedComponent), so a plugin which manage both clients and components can have different workflow
        * for clients, only triggers of plugins handling client mode are launched
        * for components, only triggers of plugins needed in dependencies are launched. They all must handle component mode.
        * component have a sendHistory attribute (False by default) which can be set to True to allow saving sent messages into history
        * for convenience, "client" is still used in method even if it can now be a component
        * a new "component" boolean attribute tells if we have a component or a client
        * components have to add themselve Message protocol
        * roster and presence protocols are not added for components
        * component default port is 5347 (which is Prosody's default port)
    - asyncCreateProfile has been renamed for profileCreate, both to follow new naming convention and to prepare the transition to fully asynchronous bridge
    - createProfile has a new "component" attribute. When used to create a component, it must be set to a component entry point
    - jp: added --component argument to profile/create
    - disconnect bridge method is now asynchronous, this way frontends can know when disconnection is finished
    - new PI_* constants for PLUGIN_INFO values (not used everywhere yet)
    - client/component connection workflow has been moved to their classes instead of being a host methods
    - host.messageSend is now client.sendMessage, and former client.sendMessage is now client.sendMessageData.
    - identities are now handled in client.identities list, so it can be updated dynamically by plugins (in the future, frontends should be able to update them too through bridge)
    - profileConnecting* profileConnected* profileDisconnected* and getHandler now all use client instead of profile
2017-02-12 17:55:43 +01:00
Goffi
9b2923f161 memory (sqlite): introduced component table, schema updated:
components are special profiles, entry_point will be the plugin to launch when they are connected.
2017-02-07 00:15:03 +01:00
Goffi
b5f1e45d4e core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet) 2017-02-06 22:54:43 +01:00
Goffi
6a8102b109 primitivus: fixed resources diplay in contact list 2017-02-06 20:51:56 +01:00
Goffi
4ed0785563 plugin XEP-0184: check if entity is allowed to see our presence before returning receipt 2017-02-06 20:47:36 +01:00
Goffi
7865ae7f99 core (roster): added isPresenceAuthorised to check if an entity is authorised to see our presence 2017-02-06 20:46:59 +01:00
Goffi
aeeb0c5635 plugin OTR, core; use of new sendMessage + OTR mini refactoring:
- new client.sendMessage method is used instead of sendMessageToStream
    - client.feedback is used in OTR
    - OTR now add message processing hints and carbon private element as recommanded by XEP-0364. Explicit Message Encryption is still TODO
    - OTR use the new sendMessageFinish trigger, this has a number of advantages:
        * there is little risk that OTR is skipped by other plugins (they have to use client.sendMessage as recommanded)
        * being at the end of the chain, OTR can check and remove any HTML or other leaking elements
        * OTR doesn't have to skip other plugins anymore, this means that things like delivery receipts are now working with OTR
          (but because there is not full stanza encryption, they can leak metadata)
        * OTR can decide to follow storage hint by letting or deleting "history" key
2017-02-05 15:00:01 +01:00
Goffi
4e13215a94 plugin XEP-0297: used sendMessage in forward, and added comment/warning:
this method need to be checked as it is not used currently, and it may need better integration in the current message sending workflow
2017-02-05 14:55:56 +01:00
Goffi
a8bd66d31d core (client): added feedback and sendMessage methods:
- feedback method is a helper method to quickly display an info message to user
    - sendMessage is the method used to send a message in the stream, using message data dictionary.
    It inclure a trigger point which can't be cancelled, it is intended for e2e encryption method which don't do full stanza encryption.
    - "send" trigger point is disabled as it is not used at the moment
2017-02-05 14:55:54 +01:00
Goffi
2455e35c28 quick app: check type in notify 2017-02-05 14:55:21 +01:00
Goffi
61765efd9e primitivus: fixed display of error if a message can't be sent 2017-02-05 14:55:21 +01:00
Goffi
89b8cb3341 plugin XEP-0280: new setPrivate method to tell server not to carbon copy it. 2017-02-05 14:55:21 +01:00
Goffi
503f8644ba core: replaced SkipHistory exception by a key in mess_data:
SkipHistory was skipping all remaining triggers just to skip history, which is not the intented behaviour.
    Now history can be skipped by setting mess_data[u'history'] = C.HISTORY_SKIP, this way we won't skip importants triggers.
    When history is skipped, mess_data[u'extra'][u'history'] will be set to C.HISTORY_SKIP for frontends, so they can inform user that the message is not stored locally.
2017-02-05 14:55:21 +01:00
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