Commit graph libervia-backend/src/plugins/plugin_xep_0054.py
Author SHA1 Message Date
Goffi
284b2e2ca7 plugin XEP-0054: return always False in isRoom is plugin XEP-0045 is not available + raise NotFound if avatar is requested for a MUC room (not the occupants, the room itself) 2018-01-03 00:18:31 +01:00
Goffi
f5f25e8ab5 misc: date update (yes it's a bit late :p ) 2017-11-03 14:31:42 +01:00
Goffi
acecf724f3 plugin XEP-0054: fixed not transmitted arguments in getAvatar 2017-06-03 22:24:53 +02:00
Goffi
7ab6802b2c plugin XEP-0054: nick handling + don't remove data on avatar set
- new getNick and setNick allow to manipulate nickname
    - setAvatar was removing any data previously in vCard, this is not the case anymore
2017-05-21 20:01:24 +02: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
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
Goffi
6395a46e87 plugin XEP-0054(XEP-0153): added a getAvatar:
getAvatar can be used to do the whole process to get avatar file (or empty string if not avatar is found) : it first look in cache and request vCard if nothing is found.
2016-09-13 22:02:52 +02:00
Goffi
d4d4f6534b plugin XEP-0054(XEP-0153): ignore image formats other than gif, jpeg and png, and empty BINVAL 2016-09-10 18:03:24 +02:00
Goffi
4f26367e7a plugin XEP-0054: fix use of full jid for room occupants 2016-09-09 23:54:33 +02:00
Goffi
b97038f281 plugin XEP-0054: renamed isInRoom to isRoom as the method only tell if the entity belong to a MUC 2016-09-09 23:54:33 +02:00
Goffi
0de4df1051 plugin XEP-0045, XEP-0054, XEP-0096: deprecated bridge method are not used anymore 2016-08-28 18:20:55 +02:00
Goffi
96afcb28d3 plugin XEP-0054: fixed getCard calls 2016-06-28 18:27:02 +02:00
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
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
Goffi
5f680931df plugin XEP-0054: use full jid to manage the card/avatar if the bare jid correspond to a MUC room 2015-12-01 17:17:09 +01:00
Goffi
621f72ec1c plugin XEP-0054: fixed presence issue when avatar is not in cache 2015-11-25 20:08:33 +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
969af13f59 plugins: added new MissingModule exceptions to plugins using third party modules 2015-09-30 17:25:09 +02:00
souliane
6f8e97860a plugin XEP-0054: fixes bug introduced by changeset 1255 (38fb8823cee8) 2015-07-14 12:57:07 +02:00
souliane
67ff77e5de massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions 2015-04-16 14:57:57 +02:00
Goffi
fbec02d396 2015 copyright dates update 2015-03-30 10:26:26 +02:00
Goffi
60bc78db4c plugin XEP-0054: "nick" is now keeped in cache:
- cache now manage different kind of data (instead of only avatar)
	- PeristentBinaryDict is used to keep cache (because we now store a dict, not just strings)
	- CACHED_DATA is a set of data kept in cache (only nick and avatar so far)
	- a signal update flag is put on "nick"
	- data in cache are reset if they are not present in cache (this avoid to keep the old value)
2015-02-24 17:01:33 +01:00
Goffi
027ab18369 plugin xep-0054: various improvments on avatars management:
- avatars_cache is now managing cache load per profile
    - use of new profileConnecting method to load persistent data, this prevent to have presence_available trigger called before cache data is loaded
    - better management of avatars already in cache (prevent decoding avatars when it is already in cache)
2015-02-09 21:39:51 +01:00
Goffi
cdfb2c4dc6 core (memory): updateEntityData now accept a "silent" argument to avoid sending signal to frontends when updating an attribute with "signalOnUpdate" flag. 2015-02-09 21:39:51 +01:00
Goffi
e134c36aa7 plugin XEP-0054: couple of fixes in VCard/avatar management:
- fixed a confusion between full jid and bare jid, resulting in always requesting VCard
    - check of cache data loading before starting
    - stored cache are restored for all jid, not only ones in roster
    - client jid cache is correctly saved/restored
    - minor other fixes

This plugin still need some work, but this patch fixes (hopefully) the major issues
2015-01-26 02:03:16 +01:00
Goffi
8ce5c1862b core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
/!\ not finished, everything is still instable !
    - bridge: DBus bridge has been modified to allow blocking call to be called in the same way as asynchronous calls
    - bridge: calls with a callback and no errback are now possible, default errback log the error
    - constants: removed hack to manage presence without OrderedDict, as an OrderedDict like class has been implemented in Libervia
    - core: getLastResource has been removed and replaced by getMainResource (there is a global better management of resources)
    - various style improvments: use of constants when possible, fixed variable overlaps, import of module instead of direct class import
    - frontends: printInfo and printMessage methods in (Quick)Chat are more generic (use of extra instead of timestamp)
    - frontends: bridge creation and option parsing (command line arguments) are now specified by the frontend in QuickApp __init__
    - frontends: ProfileManager manage a more complete plug sequence (some stuff formerly manage in contact_list have moved to ProfileManager)
    - quick_frontend (quick_widgets): QuickWidgetsManager is now iterable (all widgets are then returned), or can return an iterator on a specific class (return all widgets of this class) with getWidgets
    - frontends: tools.jid can now be used in Pyjamas, with some care
    - frontends (XMLUI): profile is now managed
    - core (memory): big improvment on entities cache management (and specially resource management)
    - core (params/exceptions): added PermissionError
    - various fixes and improvments, check diff for more details
2015-01-24 01:00:29 +01:00
Goffi
6e144c6458 core: improved roster management + misc:
- updated methods to no use anymore methods deprecated in Wokkel
    - use of full jid when it make sense instead of bare jid
    - getContacts, updateContact and delContact are now asynchronous
2014-12-10 18:32:33 +01:00
souliane
d974e9ad66 plugin XEP-0054: the fix by revision 1248 (77a4592816f6) was not complete 2014-10-22 11:42:15 +02:00
souliane
5be3ccbf38 plugin XEP-0054: fixes error message when we get a ConnectionLost failure 2014-10-19 15:25:04 +02:00
souliane
fe06c14303 core, plugins: improve a bit some log messages 2014-10-18 16:28:37 +02:00
Matteo Cypriani
71e29f5c44 misc: fixed some typos 2014-09-15 14:18:25 +02:00
souliane
25382c9db6 plugin XEP-0054: crop uploaded avatar to get a square 2014-06-19 20:33:42 +02:00
souliane
ba3deb4c3e misc: remove some pylints warnings 2014-06-15 18:18:36 +02:00
Goffi
501bc92528 core: use of the new core.log module:
/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
2014-04-19 19:19:19 +02:00
Goffi
a6897c76e0 core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned 2014-03-28 18:07:02 +01:00
Goffi
0ff17993f2 wix: fixed onShowProfile 2014-03-27 10:36:20 +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
2ca6efd8cc dates update 2014-02-04 18:32:49 +01:00
Emmanuel Gil Peyrot
31607daee1 plugin XEP-0054: also work with python2-pillow 2014-01-10 21:12:06 +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
souliane
b97f78ca93 plugins radiocol, xep-0054: better handling of upload errors:
- radiocolSongAdded is now asynchronous
- _buildAvatar return a Failure if the image is not readable
2013-12-17 18:44:53 +01: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
Goffi
1cd98e8dea fixed licences in docstrings (they are now in comments) 2013-03-08 00:36:22 +01:00
Emmanuel Gil Peyrot
0dca274360 Fix pep8 support in src/plugins. 2013-01-18 17:55:35 +01:00
Emmanuel Gil Peyrot
88074cd284 Remove every old-style class. 2013-01-18 17:55:35 +01:00
Emmanuel Gil Peyrot
27b3592e16 Remove trailing whitespaces. 2013-01-18 17:55:34 +01:00
Goffi
def79e44cd dates update 2013-01-07 23:30:13 +01:00
Goffi
44a042df6d plugin XEP-0054: fixed bad image resizing 2013-01-07 23:08:45 +01:00