Commit graph

2,523 commits

Author SHA1 Message Date
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
Goffi
1301132bed memory (sqlite): files handling:
/!\ new database schema version

- added a table to handle files metadata and hierarchy.
- new methods getFiles and setFile allow respectively to retrieve files corresponding to filters, and to set metadata for one file.
- fixed stmnt_regex to detect correcly new schema (during schema validation/update on init)
2018-02-28 18:28:39 +01:00
Goffi
6f64d7d0a3 core (trigger): new returnPoint method:
Normally trigger return value is a boolean used to check if normal workflow must be continued or stopped.
This method add a way to also specify a return value to the method, in addition to the "continue or not" boolean.
2018-02-28 18:28:39 +01:00
Goffi
b27f385511 core (client): component improvments:
- renamed component boolean to is_component for more clarity
- profileConnected/profileDisconnected don't use a suffix anymore, it's called for both client and component.
  To check for there, the is_component boolean is enough
- fixed dependencies handling
- componentStart is not mandatory anymore, as a component can just be used with its handler
2018-02-28 18:28:39 +01:00
Goffi
0d5b8b5a84 core (client): set default timeout of IQ to 60 seconds 2018-02-28 18:28:39 +01:00
Goffi
6aee4c07cf core: new getLocalPath method to retrieve a path in SàT local dir, which may be specific to a profile or component 2018-02-28 18:28:39 +01:00
Goffi
54e4d5d3a9 core (exceptions): added ClientTypeError to deal when a code should not be executed by a client or component profile. 2018-02-28 18:28:39 +01:00
Goffi
a89b5f0957 core (constants): new constants to handle files, progress, component, permissions (will be used in the upcoming patches) 2018-02-28 18:28:39 +01:00
Goffi
976da08f5d jp (common/table): a column can be hidden + fix for empty tables
- avoid crash when table is empty
- a column can now be hidden on display, this can be useful if one data is needed (e.g. to change color of an other column with a filter),
  but we don't want to display it
- filters have a new argument with all data of a row (for the same reason as above, one column can be used to change display of other column)
2018-02-28 18:28:39 +01:00
Goffi
195f30b4d5 jp (profile/create): errback handling 2018-02-28 18:28:39 +01:00
Goffi
0e5e340935 jp (event): added missing arg to _attend_filter 2018-02-28 18:28:39 +01:00
Goffi
d80dd87bcc jp (base): added verbosity property to CommandBase 2018-02-28 18:28:29 +01:00
Goffi
60b8c8fa73 plugin pipe/stream, file transfert: refactoring and improvments:
this is a big patch as things had to be changed at the same time.

- changed methods using profile argument to use client instead
- move SatFile in a new tools.stream module, has it should be part of core, not a plugin
- new IStreamProducer interface, to handler starting a pull producer
- new FileStreamObject which create a stream producer/consumer from a SatFile
- plugin pipe is no more using unix named pipe, as it complicate the thing,
  special care need to be taken to not block, and it's generally not necessary.
  Instead a socket is now used, so the plugin has been renomed to jingle stream.
- bad connection/error should be better handler in jingle stream plugin, and code should not block anymore
- jp pipe commands have been updated accordingly

fix bug 237
2018-02-08 00:37:42 +01:00
Goffi
ece10e8cd2 plugin NAT-port: raise MappingError if something get wrong during "addportmapping" + log unexpected errors (i.e. everything else than MappingError) 2018-02-01 07:24:34 +01:00
Goffi
aec189c087 plugin XEP-0166: added errback to terminate, which only logs issues 2018-02-01 07:21:41 +01:00
Goffi
9ab577462d jp (base): fixed assertion error when using CommandAnswering 2018-01-30 08:43:52 +01:00
Goffi
368571ea24 jp (forums): forums handling commands, first draft 2018-01-30 08:17:17 +01:00
Goffi
cfcc673826 plugin forums: first draft:
this plugin handle forums hierarchy, where forums link to topics which themselves link to blog nodes.
2018-01-30 08:17:08 +01:00
Goffi
387c10cc0d dates update 2018-01-26 11:14:13 +01:00
Goffi
4d7bc8aaa1 tools (common/data_objects): accept same parameters as format en quote their values in OnClick.formatUrl 2018-01-24 09:12:12 +01:00
Goffi
f857a86740 plugin blog import dotclear: use a smaller and lower case prefix to generate ids 2018-01-24 09:10:12 +01:00
Goffi
80efb4b121 plugin XEP-0277: use shortuuid instead of uuid + use item's XMPP URI for atom ID 2018-01-22 22:00:46 +01:00
Goffi
c09a5feb3c plugin blog static: added background parameter, to set an image 2018-01-22 08:36:36 +01:00
Goffi
773b9b8948 tools (common/data_objects): use lists instead of generators for BlogItem.groups and BlogItem.tags 2018-01-21 20:20:38 +01:00
Goffi
ba046b33dd tool (utils): import directly parser from dateutil 2018-01-21 13:04:16 +01:00
Goffi
7b833e62a6 tools (common/data_objects): BlogItem has now a uri property to generate its own XMPP URI 2018-01-19 17:41:10 +01:00
Goffi
d4cfd510c8 plugin XEP-0277: microblog namespace is now registered 2018-01-19 17:40:06 +01:00
Goffi
8cce1d1ba0 core: 'x-data' namespace is now registered 2018-01-19 17:39:38 +01:00