Commit graph libervia-backend/src/memory
Author SHA1 Message Date
Goffi
56ed5f13a5 core(memory): fixed last resource 2014-03-28 19:11:00 +01:00
Goffi
95678d7967 core, plugin XEP-0115: discovery refactoring:
- hashing algorithm of XEP-0115 has been including in core
    - our own hash is still calculated by XEP-0115 and can be regenerated with XEP_0115.recalculateHash
    - old discovery methods have been removed. Now the following methods are used:
        - hasFeature: tell if a feature is available for an entity
        - getDiscoInfos: self explaining
        - getDiscoItems: self explaining
        - findServiceEntities: return all available items of an entity which given (category, type)
        - findFeaturesSet: search for a set of features in entity + entity's items
      all these methods are asynchronous, and manage cache automatically
    - XEP-0115 manage in a better way hashes, and now use a trigger for presence instead of monkey patch
    - new FeatureNotFound exception, when we want to do something which is not available
    - refactored client initialisation sequence, removed client.initialized Deferred
    - added constant APP_URL
    - test_plugin_xep_0033.py has been temporarly deactivated, the time to adapt it
    - lot of cleaning
2014-03-28 18:07:22 +01:00
Goffi
382d49a628 core (memory): entities cache improvments:
- entities cache is no more limited to bare jid
    - resources are now automatically updated in bare jid cache
2014-03-28 18:07:17 +01:00
souliane
f6673e0725 plugin account, groupblog: user can erase all their microblogs at once 2014-03-27 02:24:20 +01:00
souliane
fceb06836f memory: be sure that local_dir exists before creating a new database 2014-03-25 14:57:38 +01:00
souliane
1066fdb4eb memory: bug fix the current local_dir after sat.conf is auto-updated 2014-03-24 16:43:08 +01:00
souliane
03d4dcf029 plugin account: bug fix profile deletion from the database + unsubscribe the contacts 2014-03-24 16:21:14 +01:00
souliane
3075585d9d core, memory: use XDG recommended paths as the defaults for the config and local directories 2014-03-23 22:43:43 +01:00
Goffi
6d768028d1 core: removed default_config:
- constants in core.default_config moved to core.constants
    - removed unused host.getConst and host.setConst
    - APP_NAME* used where it make sense
2014-03-22 17:48:10 +01:00
Goffi
c67faecba1 core: added IQ_SET to core.constants + getLastResource now manage correctly jid.JID 2014-03-22 13:42:59 +01:00
Goffi
005ec59a8a core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@' 2014-03-21 16:27:09 +01:00
Goffi
e689f6bb34 core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there 2014-03-21 16:08:11 +01:00
Goffi
9bd81494d1 core: minor docstring fixes 2014-03-21 15:03:51 +01:00
souliane
88baf0791b core (memory): asyncDeleteProfile can force the deletion of a profile, even if it's connected (when called from the backend only) 2014-03-03 15:37:49 +01:00
souliane
d158589881 core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile 2014-03-03 09:59:10 +01:00
Goffi
7aaea47da8 core (memory): added 'no' value management in configuration's booleans 2014-02-25 23:03:13 +01:00
Goffi
a280080563 core (sqlite): automatic database update:
- new Updater class check database consistency (by calculating a hash on the .schema), and updates base if necessary
    - database now has a version (1 for current, 0 will be for 0.3's database), for each change this version will be increased
    - creation statements and update statements are in the form of dict of dict with tuples. There is a help text at the top of the module to explain how it works
    - if we are on a development version, the updater try to update the database automaticaly (without deleting table or columns). The Updater.generateUpdateData method can be used to ease the creation of update data (i.e. the dictionary at the top, see the one for the key 1 for an example).
    - if there is an inconsistency, an exception is raised, and a message indicate the SQL statements that should fix the situation.
    - well... this is rather complicated, a KISS method would maybe have been better. The future will say if we need to simplify it :-/
    - new DatabaseError exception
2014-02-23 23:30:32 +01:00
souliane
24beb81688 misc: fix unnamed arguments in format strings 2014-02-17 14:58:26 +01:00
souliane
e63752db76 memory (sqlite): the result of pickle.dumps in addToHistory must be encoded for the special characters to be stored. 2014-02-12 21:46:48 +01:00
souliane
7ea4dca1b0 memory: bug fix to not register twice frontends parameters + added some tests for param update 2014-02-07 17:10:24 +01:00
Goffi
eeff94469a core: registerNewAccount partial fix 2014-02-04 18:54:06 +01:00
Goffi
2ca6efd8cc dates update 2014-02-04 18:32:49 +01:00
Goffi
b3fb68cb63 core, frontends: XMLUI refactoring:
- XMLUI now use objects with 2 main classes: widgets (button, label, etc), and container which contain widgets according to a layout
    - widgets and containers classes are found through introspection, thereby it's really easy to add a new one
    - there is still the AddWidgetName helper, for example AddText('jid', 'test@example.net') will add a StringWidget with name "jid" and default value "test@example.net"
    - container can be inside other containers. changeContainer change the first parent container
2014-02-04 18:19:00 +01:00
souliane
78a3d845db memory: factorize the node checks in Params.__constructProfileXml 2014-01-05 07:26:41 +01:00
souliane
821f0b36ef memory: bug fix related to method paramsRegisterApp + getParams was not always returning a Deferred 2014-01-04 21:13:51 +01:00
souliane
409bbccebe memory: fixed wrong information in the docstrings for security_limit 2014-01-04 21:12:49 +01:00
souliane
4a0d8be8ec core, bridge: new method paramsRegisterApp to register frontend's specific parameters 2013-12-27 13:28:26 +01:00
Goffi
5a00dc9503 core: i18n refactoring:
- _() is no more installed in __builtin__
    - instead, there is a new sat.core.i18n module
    - added D_() method for deferred translation
    - languageSwitch method allow to dynamically change translation language
    - import gettext is tested against ImportError, and dummy methods are used when not available (mainly useful for Libervia)
2013-12-29 17:06:01 +01:00
Goffi
069a250b04 backend, frontends: callbacks refactoring:
- launchAction is now async, and return a dictionary for its result
    - no more action_id, actionResult* are deprecated
    - callback system is about to be unified
2013-12-24 15:19:08 +01:00
Goffi
3f236bbb32 core (memory): added optional profile checking in Sessions:
if profile is set in newSession, getProfile must be used instead of __getitem__, and it is checked to insure session is not used by the wrong profile
2013-12-24 15:19:08 +01:00
Goffi
1550d06922 core (memory): new Sessions management class (similar to dict) 2013-12-24 15:19:08 +01:00
Goffi
b6aaecc5c2 core, bridge: better GenericException handling 2013-12-17 00:56:39 +01:00
souliane
bbadfda25b core: bug fix for requestServerDisco in sat_main.py + added getAllServerIdentities method in memory.py 2013-12-16 14:35:26 +01:00
souliane
718bb98300 plugin XEP-0033: implementation of the addressing feature:
- frontends pass the recipients in the extra parameter of sendMessage
    - backend checks if the target server supports the feature (this is not done yet by prosody plugin)
    - features and identities are cached per profile and server
    - messages are duplicated in history for now (TODO: redesign the database)
    - echos signals are also duplicated to the sender (FIXME)
2013-12-11 17:16:53 +01:00
Goffi
4b662563c9 core: management of _list and _dict in sat.conf 2013-12-12 01:06:19 +01:00
Goffi
f7efb167c8 plugin XEP-0050: Ad-Hoc commands first draft (answering part) 2013-12-10 17:25:31 +01:00
Goffi
72fa3c5c70 core (memory): fixed setDefault behaviour + minor refactoring 2013-11-28 17:23:08 +01:00
souliane
63ba8ab235 memory: fixed getHistory behavior when parameter between=True:
- the previous behavior returns the messages between X and Y + between X and X
2013-10-23 00:28:00 +02:00
souliane
23d8b52f5b wix, misc: use picture of dimension 32x32 for tray icon + better PEP-8 compliance 2013-10-22 09:41:27 +02:00
souliane
9c2087847a core (memory): cleaned the part for load/save to xml (not used) 2013-10-18 19:23:03 +02:00
Goffi
8624c3c547 core, bridge: extra parameter is saved in history:
- added extra data in getHistory return value
    - extra data is saved in database
    /!\ WARNING: DATABASE SCHEMA HAS CHANGED /!\
to update sqlite database: ALTER TABLE history ADD COLUMN extra BLOB;
2013-11-07 15:29:39 +01:00
Goffi
bd7f2d6e84 core: importParams renamed to updateParams: it now updates the parameter instead of appending children if it find an existing one. 2013-10-31 17:14:15 +01:00
souliane
6f58566118 bridge, memory: added the parameter security_limit to asyncGetParamA so it can be used from libervia. refactorization in memory.py are related to that. 2013-10-02 20:25:19 +02:00
Goffi
92d861f334 core: misc bug fixes 2013-09-21 15:34:10 +02:00
souliane
9378880e62 plugin XEP-0085: renamed category and parameter 2013-09-07 19:50:12 +02:00
souliane
75c414afde core: fix for methods signature 2013-09-08 15:00:15 +02:00
souliane
2bf3694fd0 core: added the security_limit to setParam
- params with a security greater than security_limit can not be modified
- special value: security_limit < 0 disable the check (all params can be modified)
2013-09-07 02:03:17 +02:00
souliane
4c30dcf240 core: better handling of profile_key and don't write the param file anymore
- new error ProfileNotSetError and some methods use the default @NONE@ instead of @DEFAULT@
- do not output the .sat/param file anymore, it is not needed and created confusion
- plugin XEP-0054: remove an error message at startup
2013-09-05 21:03:52 +02:00
souliane
174a0d9862 core: memory's updateEntityData improvments.
- passing @ALL@ to updateEntityData updates the specified key for all entities
    - passing @NONE@ to updateEntityData deletes the specified key
2013-09-08 19:12:59 +02:00
souliane
7652fd3a15 core: security attribute added to the parameters
- getParams, getParamsUI and getParamsForCategory have a security_limit parameter to filter
- parameters with security = 0 can be retrieved/modified from Libervia
2013-09-05 20:28:44 +02:00