Commit graph libervia-backend/src/memory
Author SHA1 Message Date
Goffi
04515e5013 plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass):
- bridge methods/signals now all start with "muc" to follow new convention
    - internal method use client instead of profile to follow new convention
    - removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added
    - cleaned/simplified several part of the code. checkClient removed as it is not needed anymore
    - self.clients map removed, muc data are now stored directly in client
    - getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane.
        /!\ This break all room game plugins for the moment
    - use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
2016-06-27 21:45:11 +02:00
Goffi
a7de473107 backend, frontends: message refactoring (huge commit):
/!\ several features are temporarily disabled, like notifications in frontends

next step in refactoring, with the following changes:
    - jp: updated jp message to follow changes in backend/bridge
    - jp: added --lang, --subject, --subject_lang, and --type options to jp message + fixed unicode handling for jid
    - quick_frontend (QuickApp, QuickChat):
        - follow backend changes
        - refactored chat, message are now handled in OrderedDict and uid are kept so they can be updated
        - Message and Occupant classes handle metadata, so frontend just have to display them
    - Primitivus (Chat):
        - follow backend/QuickFrontend changes
        - info & standard messages are handled in the same MessageWidget class
        - improved/simplified handling of messages, removed update() method
        - user joined/left messages are merged when next to each other
        - a separator is shown when message is received while widget is out of focus, so user can quickly see the new messages
        - affiliation/role are shown (in a basic way for now) in occupants panel
        - removed "/me" messages handling, as it will be done by a backend plugin
        - message language is displayed when available (only one language per message for now)
        - fixed :history and :search commands
    - core (constants): new constants for messages type, XML namespace, entity type
    - core: *Message methods renamed to follow new code sytle (e.g. sendMessageToBridge => messageSendToBridge)
    - core (messages handling): fixed handling of language
    - core (messages handling): mes_data['from'] and ['to'] are now jid.JID
    - core (core.xmpp): reorganised message methods, added getNick() method to client.roster
    - plugin text commands: fixed plugin and adapted to new messages behaviour. client is now used in arguments instead of profile
    - plugins: added information for cancellation reason in CancelError calls
    - plugin XEP-0045: various improvments, but this plugin still need work:
        - trigger is used to avoid message already handled by the plugin to be handled a second time
        - changed the way to handle history, the last message from DB is checked and we request only messages since this one, in seconds (thanks Poezio folks :))
        - subject reception is waited before sending the roomJoined signal, this way we are sure that everything including history is ready
        - cmd_* method now follow the new convention with client instead of profile
        - roomUserJoined and roomUserLeft messages are removed, the events are now handled with info message with a "ROOM_USER_JOINED" info subtype
    - probably other forgotten stuffs :p
2016-06-20 18:41:53 +02:00
Goffi
feadc8c89e memory (sqlite): fixed handling of extra (pickled data) by using sqlite3.Binary 2016-06-19 22:22:13 +02:00
Goffi
74ebd4cb66 memory (sqlite): better handling of IntegrityError 2016-06-19 22:22:12 +02:00
Goffi
f12803fa65 backend, frontend: messages refactoring (huge commit, not finished):
/!\ database schema has been modified, do a backup before updating

    message have been refactored, here are the main changes:

    - languages are now handled
    - all messages have an uid (internal to SàT)
    - message updating is anticipated
    - subject is now first class
    - new naming scheme is used newMessage => messageNew, getHistory => historyGet, sendMessage => messageSend
    - minimal compatibility refactoring in quick_frontend/Primitivus, better refactoring should follow
    - threads handling
    - delayed messages are saved into history
    - info messages may also be saved in history (e.g. to keep track of people joining/leaving a room)
    - duplicate messages should be avoided
    - historyGet return messages in right order, no need to sort again
    - plugins have been updated to follow new features, some of them need to be reworked (e.g. OTR)
    - XEP-0203 (Delayed Delivery) is now fully handled in core, the plugin just handle disco and creation of a delay element
    - /!\ jp and Libervia are currently broken, as some features of Primitivus

    It has been put in one huge commit to avoid breaking messaging between changes.
    This is the main part of message refactoring, other commits will follow to take profit of the new features/behaviour.
2016-05-24 22:11:04 +02:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
046fb62a52 core (memory/params): fixed exception when setting an empty password 2016-03-26 18:43:54 +01:00
Goffi
8403bd61ae core (memory, config): moved parseMainConf to tools/config so it can be used by frontends too 2016-02-29 16:13:47 +01:00
Goffi
d7bca38b31 core (params): return given profile for ProfileUnknownError 2016-01-25 17:03:45 +01:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
Goffi
b140240996 core (disco): display a warning when a disco info/items request failed, and return empty DiscoInfo/DiscoITems 2015-12-17 21:58:41 +01:00
souliane
4d3d6fb8b8 memory (params): fixes loading user value and building params XML for jids_list type 2015-12-15 17:43:36 +01:00
Goffi
0ecb55517d core (params): removed unused values 2015-12-15 16:25:37 +01:00
Goffi
77c3e83ec8 plugin extra_pep, params: fixed insecure building of jids_list 2015-12-15 16:25:19 +01:00
souliane
9e0b24a4a5 memory (params): parameter jids_list values are specified with <jid>...</jid> 2015-12-15 14:12:19 +01:00
souliane
a29630c3b6 memory (params): forbid to pass a value to a parameter of type "list" with <param value...> 2015-12-15 13:33:35 +01:00
Goffi
d978e4918b core: avoid initialisation blocking when a long callback is added to backend.initialised (could prevent sessions starting) 2015-12-07 13:10:44 +01:00
Goffi
1a16f085d0 core (sqlite storage): do explicit delete to profile linked tables for deleteProfile 2015-11-30 20:42:14 +01:00
Goffi
a3c15277bc core (memory): fixed bad memory cleaning on asyncDeleteProfile 2015-11-30 20:40:55 +01:00
Goffi
fad4200be3 core (memory): asyncCreateProfile fix: a fake session is created to set general password param 2015-11-27 16:52:14 +01:00
Goffi
1bf3950ce6 core (memory): profile is checked in startSession (an error is raised if it doesn't exist) 2015-11-27 16:50:29 +01:00
Goffi
3d8d66fa43 core (memory): stopSession implementation 2015-11-27 16:48:41 +01:00
Goffi
939b6ba80b core (memory): catch exceptions.UnknownEntityError in getMainResource 2015-11-26 17:00:18 +01:00
Goffi
566de1dd33 core(params): replaced isConnected by isSessionStarted for profile update signal when a general param is modified 2015-11-26 16:04:45 +01:00
Goffi
c58da8d413 profile (params): fixed password setting: if profile was not connected, set was silently ignored 2015-11-26 15:47:01 +01:00
Goffi
95ad000f62 core (disco): disco hashes are now stored in database to avoid doing the same disco request on next load 2015-11-25 21:41:15 +01:00
Goffi
9c4ec1595c plugin XEP-0054: fixed vcard-update callback which was updating avatar when hash was empty, resulting in a really slow start 2015-11-25 20:01:39 +01:00
Goffi
5afdf1c1ca plugin XEP-0065: fixed bad error handling 2015-11-25 13:03:10 +01:00
souliane
3fa1ea0376 memory: fixes asyncCreateProfile to not overwrite the personal key 2015-11-23 18:51:15 +01:00
Goffi
cb27db7cdf core: fixed getStringParamA 2015-11-23 17:50:23 +01:00
Goffi
66739d9dfc core (param), plugin file: set security_limit for acount changes, backend (dis)connection, and put a higher one for file send 2015-11-23 13:19:42 +01:00
Goffi
ad973c6a2c core: fixed launchAction:
- getClient now raise a NotFound error if client is not available
    - errors ConnectedProfileError, NotConnectedProfileError anf ProfileKeyUnknownError renamed for consistency (all profile error must prefixed by Profile)
    - launchAction fixed, the case where client is not available is handled
    - kept actions are actuall1y removed on launchAction
2015-11-18 11:06:24 +01:00
Goffi
5702b2a849 core (params): removed resource from default JabberID (example value), as it is best practive to have resource binded by server. Advanced used can force it if needed though. 2015-11-16 11:58:11 +01:00
Goffi
182f192703 core, bridge: added a profileSetDefault method 2015-11-14 19:18:10 +01:00
Goffi
e0a28858a8 core: profile session starting and connection are now separated. Moved profile session starting/authentication to memory module 2015-11-14 19:18:10 +01:00
Goffi
736dbfa1b4 core (memory): fixed a case where getProfileName was returning an empty string instead of raising an errror 2015-11-14 19:18:10 +01:00
Goffi
ce4e717ea8 core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category 2015-11-14 19:18:10 +01:00
Goffi
bfd143b1e4 bridge, core(params): removed obsolete methods:
- getParams and getParamsForCategory are removed from bridge: XMLUI is now used in place of the old params XML
    - getParamsForCategory has also been removed internaly, as it is now unused, getParams is still used to construct the XMLUI
2015-11-14 19:18:07 +01:00
Goffi
341143445b core (disco): use of “profile” instead of “profile_key” in several disco methods 2015-11-02 22:02:41 +01:00
Goffi
76e571e18b plugin ip, params: plugin IP discovery, first draft:
- a dedicated plugin now manage IP discovery, for now it uses external website, but it should implement XEP-0279 soon
    - a permission is requested to user for calling an external website. Once the permission is granted (it's global), it is not asked anymore.
    - the ip is discovered on demand, and cache is kept for the session.
    - memory.params.getParamA has a new parameter use_default, which allow to get None when a parameter is not set, instead of the default value.
        This allow to detected when we need to do the first permission request. memory.getParamA don't have this parameter.
2015-09-29 17:54:22 +02:00
Goffi
74d91860ad core (memory, params): minor docstrings updates 2015-09-25 19:19:12 +02:00
souliane
95c7e2b809 core (params): fixes jid_list to use node's default value when no user value is defined 2015-08-22 10:28:07 +02:00
Goffi
456ff0ab6c core (params): fixed exception on empty jids list 2015-08-25 20:20:53 +02:00
Goffi
f41aed19af core (disco): use of failure.Failure when raising FeatureNotFound to avoid a jump in debugger in debug mode 2015-08-25 16:52:18 +02:00
Goffi
9895ceb32f core (disco): added checkFeatures to check several features at once + identities are now managed with a tuple in findFeaturesSet and checkFeatures 2015-08-25 16:05:01 +02:00
Goffi
690b1c2213 core (disco): fixed bad indentation resulting in bad result in findFeaturesSet 2015-08-21 19:23:13 +02:00
Goffi
135fba2de1 core, plugin watched: new plugin, show an alert when a watched entity goes online 2015-08-20 18:43:56 +02:00
Goffi
a39e66b598 core (params): jids_list type management 2015-08-20 18:35:27 +02:00
Goffi
4623af2784 core (memory): fixed a double timer.cancel in Sessions 2015-08-18 10:36:41 +02:00
Goffi
0f10526746 core: getProfileName no raise ProfileUnknownError + minor doc fixes 2015-08-16 00:41:58 +02:00