Commit graph

2,550 commits

Author SHA1 Message Date
Goffi
60eab27872 jp (base): new confirmOrQuit helper method to ask confirmation to user, and quit if he cancel 2018-03-31 18:21:56 +02:00
Goffi
c762d0cc31 README: specified URIs location for tickets and merge requests 2018-03-31 17:20:38 +02:00
Goffi
19155ef4d7 plugin uri finder: plugin to find URIs in well-known locations 2018-03-31 17:20:14 +02:00
Goffi
31c8a752bb jp: new argument pubsub_default can be used in Commands to replace default value in help string 2018-03-31 17:10:43 +02:00
Goffi
ec0c5104ed plugin merge-requests: fixed labels (they were using textbox instead of list) 2018-03-30 19:49:35 +02:00
Goffi
514f4e0285 jp (merge-request/import): added import command 2018-03-30 17:53:57 +02:00
Goffi
60043be6b4 plugin merge-requests, mercurial merge-requests: merge request import implementation 2018-03-30 17:53:11 +02:00
Goffi
2422d0a1d7 plugin XEP-0115: fixed caps initial check 2018-03-30 17:51:32 +02:00
Goffi
291127e677 jp (merge/get): "get" command first draft:
get allows to retrieve a merge request, to display it. By default it only display "id", "title" and "body" ; verbosity must be augmented to display more.
2018-03-29 09:09:33 +02:00
Goffi
5fbe44e849 jp (xmlui): added whitelist, read_only and values_only options:
- whitelist is set on XMLUI creation, it's the same as for other frontends
- read_only is set on XMLUI display, it indicates that input are not expected
- values_only is set on XMLUI display, it indicates that only values are to be displayed (it implies read_only)
2018-03-29 09:09:32 +02:00
Goffi
25e6a8748d frontends (xmlui): added whitelist argument:
when set whitelist indicate that only widgets (and their eventual labels) with names in this list are to be kept.
This option is mutually exclusive with ignore.
2018-03-29 09:03:19 +02:00
Goffi
d2dadbaf46 jp (base): add --max option:
when MULTI_ITEMS is set, --max options is automatically added, except if NO_MAX flag is set.
2018-03-29 08:59:38 +02:00
Goffi
b7e2de70d7 jp (base): fixed use_pubsub when pubsub_flags is not needed 2018-03-29 08:57:27 +02:00
Goffi
1c29b1cdc1 tools (common/data_objects): fixed Identity 2018-03-26 08:06:35 +02:00
Goffi
a9105242d0 core: added bare_jid and identities arguments to discoGetByFeatures:
- bare_jid indicate if we are looking for server implementation (True) of devices (False)
    - identities is an optional filter, only entities with this identities set will be kept
2018-03-26 08:01:06 +02:00
Goffi
afb4dcd6bb plugin XEP-0234: fixed regex import 2018-03-25 20:51:02 +02:00
Goffi
b9e3707412 core: new discoFindFeatures method which return all server services/roster entities implementing a set of features. 2018-03-24 10:46:09 +01:00
Goffi
7ffb8efb92 core (disco), plugin XEP-0115: client use + capabilities hash improvment:
- modified a couple of method from memory to use client instead of profile
- XEP-0115: don't use unique hash for all clients anymore, as disco can be different between clients/components, and even between clients (different identity for instance).
    hash is now generated per client on each new session.
2018-03-24 10:44:37 +01:00
Goffi
6f8834f9da jp: pubsub options refactoring:
There is now only "use_pubsub", and specification are set using "pubsub_flags" argument when instantiating CommandBase.
Options are more Python Zen compliant by using explicit arguments for item, draft, url instead of trying to guess with magic keyword and type detection.
Pubsub node and item are now always using respecively "-n" and "-i" even when required, this way shell history can be used to change command more easily, and it's globally less confusing for user.
if --pubsub-url is used, elements can be overwritten with individual option (e.g. change item id with --item).
New "use_draft" argument in CommandBase, to re-use current draft or open a file path as draft.
Item can now be specified when using a draft. If it already exists, its content will be added to current draft (with a separator), to avoid loosing data.
common.BaseEdit.getItemPath could be simplified thanks to those changes.
Pubsub URI handling has been moved to base.py.
2018-03-21 19:13:22 +01:00
Goffi
03e9e2b281 frontends (tools/misc): new FlagsHandler class, a simple class to help handling option flags 2018-03-21 19:07:06 +01:00
Goffi
f1b9ef2c21 jp (output/template): fixed template output (media_dir was missing) 2018-03-21 19:07:00 +01:00
Goffi
a1f953f825 component file sharing: changed pubsub identity:
pubsub service disco identity has been changed to non standard "virtual" type, to avoid it to be used as main pubsub service by the client.
2018-03-18 11:26:01 +01:00
Goffi
76f39ca0c4 component file sharing: comments metadata:
new <comments> element is added to file metadata, it contains the URL to the comments virtual node and the count of comments (this way client knows if it make sense to request comments or not).
Fixed triggers in plugin XEP-0264 (return value was missing).
New trigger in plugin XEP-0329 to allow component to add metadata (used here for comments url).
2018-03-16 18:43:11 +01:00
Goffi
07fa89be84 component file sharing: comments handling first draft:
comments use a minimal pubsub service which create virtual nodes for each files. A pubsub request to org.salut-a-toi.file_comments/[FILE_ID] allow to handle comments in classic way.
Permissions are the same as for files (i.e. if an entity can see a file, she can comment it).
2018-03-16 17:06:35 +01:00
Goffi
97f19b2e52 core (memory, sqlite): added fileUpdate method to update "extra" and "access" avoiding race condition 2018-03-16 17:03:46 +01:00
Goffi
50a7be4fe4 core: use C.bool to detect value of "handler" field in PLUGIN_INFO 2018-03-16 17:00:57 +01:00
Goffi
3b737b6fec core (constants): accept "yes" as a True value in bool() 2018-03-16 17:00:09 +01:00
Goffi
5fc249a075 jp (common): assure nosplitright in default commands for edition with vim 2018-03-16 16:59:16 +01:00
Goffi
c6cac9d6bd component file sharing, plugin XEP-0231: thumbnail are now returned by component using Bits of Binary:
thumbnails are saved in common cache, and sent blindly on request.
There is no access check for thumbnails yet, which is a security/privacy issue, but mitigated by the fact that content id must be known to retrieve the file.
Proper access check is planed.
2018-03-14 08:14:32 +01:00
Goffi
2560c9d3f2 plugin XEP-0264: handle truncated files 2018-03-14 08:11:20 +01:00
Goffi
2e18724e7b plugin XEP-0329: fixed extra key serialisation before sending to bridge 2018-03-14 08:10:31 +01:00
Goffi
efd3c8d0b4 component file sharing: fixed hash handling (key has been renamed to "file_hash") 2018-03-14 08:08:42 +01:00
Goffi
d4ed57dadc core (memory): use bare jid for owner in setFiles:
this makes files unusable for MUCs private conversations, but it doesn't make much sense to use it in this case.
2018-03-14 08:07:24 +01:00
Goffi
41ce2e27e6 core (memory/cache): new getMetadata method to retrieve metadata without opening the file 2018-03-14 08:05:55 +01:00
Goffi
d51dc5b2eb jp (file/send): --name can now be specified 2018-03-14 07:57:04 +01:00
Goffi
82b8250fac template: added icon handling:
2 new methods can be used:
- icon_defs to include definitions of svg icons
- icon to use one previously declared svg

plain svg is used instead of icon fonts to improve accessibility.
2018-03-11 19:18:00 +01:00
Goffi
261e3b3099 file sharing component: thumbnails integration first draft:
if an uploaded file is detected as an image, 2 thumbnails (small and medium size) are generated automatically.
2018-03-02 17:53:31 +01:00
Goffi
24fba151c4 plugin XEP-0264: thumbnails handling implementation 2018-03-02 17:53:31 +01:00
Goffi
29d9713462 plugin XEP-0234: some cleaning + added triggers to allow plugins to change parsing/generation of <file> element 2018-03-02 17:53:19 +01:00
Goffi
7faccbd03b plugin XEP-0231: separated the requestData code in a method which can called independantly + some minor improvments 2018-03-02 17:45:23 +01:00
Goffi
97b3929405 plugin XEP-0054: use .jpg instead of .jpe for jpeg files 2018-03-02 17:43:41 +01:00
Goffi
7bc5b99ea1 core (memory/cache): common cache:
host has now a common_cache attribute for data which can be shared between profiles. client.cache is for private data
2018-03-02 17:40:09 +01:00
Goffi
c1dc9d4599 core (memory): fixed _getParentDir call in setFile 2018-03-02 17:37:41 +01:00
Goffi
0d8938f92f core (memory/sqlite): renamed column for files from hash to file_hash:
the version has not been changed to avoid too creating update for such a small change.
Even if generally a database change means a version change, this one has not be wide spreaded, and it will be updated automatically for dev version.
A manual "drop table files" using sqlite3 shell might clean things up though.
The reason of the column name change is that hash is named file_hash in code (because "hash" is a reserved word), and using the same name simplify data manipulation.
2018-03-02 17:36:43 +01:00
Goffi
ee7ad2bafe plugin XEP-0054: removed Image.ANTIALIAS filter:
Image.ANTIALIAS filter is not needed anymore in Pillow: http://pillow.readthedocs.io/en/3.0.x/releasenotes/2.7.0.html#default-filter-for-thumbnails
2018-03-01 09:04:36 +01:00
Goffi
ac1740d235 jp (file): file sharing + improvments:
- file sending now handle --path and --namespace (used to specify how to share a file)
- implemented file request, a file must be identified by it's name or hash, using --path when possible
- added share subcommands
- share/list allows to list file shared by an entity at a specific path
- share/path allows one to share a local path privatly (only accessible by its bare jid), publicly or to a whitelist of jids
2018-02-28 18:28:39 +01:00
Goffi
7ea8c79dbd plugin file sharing component: first draft:
this component act as an endpoint where a user can store and retrieve its files using Jingle.
2018-02-28 18:28:39 +01:00
Goffi
9a87d5c355 XEP-0329: implementation of File Information Sharing:
the plugin do an implementation for client and component.
For client, any directory from local file can be shared.
For component file are stored using new file handling mechanism from SàT.
Permission is handled, using "public" and "whitelist" for now.
2018-02-28 18:28:39 +01:00
Goffi
2e5991575f XEP-0065,XEP-0096,XEP-0166,XEP-0235,XEP-0300: file transfer improvments:
huge patch sorry :)

many things are improved by this patch, notably:
- updated to last protocol changes (urn:xmpp:jingle:apps:file-transfer:5 and urn:xmpp:hashes:2)
- XEP-0234: file request implementation
- XEP-0234: methods to parse and generate <file> element (can be used by other plugins easily)
- XEP-0234: range data is now in a namedtuple
- path and namespace can be specified when sending/requesting a file (not standard, but needed for file sharing)
- better error/termination handling
- trigger points to handle file requests by other plugins
- preparation to use file plugins with components
2018-02-28 18:28:39 +01:00
Goffi
db45d45be5 core (memory): file metadata handling methods:
- checkFilePermission check that requested permission(s) are granted for a file (without checking the parents)
- checkPermissionToRoot check that requested permission(s) are granted for a file and all its parents
- getFiles retrieve file(s) according to filter, and check permissions by default
- setFile create a file (and its parents if needed) and check permissions by default
2018-02-28 18:28:39 +01:00