Commit graph libervia-backend/src/plugins/plugin_misc_groupblog.py
Author SHA1 Message Date
Goffi
387c10cc0d dates update 2018-01-26 11:14:13 +01:00
Goffi
f5f25e8ab5 misc: date update (yes it's a bit late :p ) 2017-11-03 14:31:42 +01:00
Goffi
425d342183 plugin groupblog, XEP-0060: added ACCESS_PUBLISHER_ROSTER and switched to it in groupblog 2017-03-23 09:11:25 +01:00
Goffi
3bc851abf2 core (memory/disco): getInfos now handle node + use client instead of profile in many methods 2017-02-12 20:43:20 +01: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
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
2d1d286be2 core (tools): moved common to a separate package, and put data method in a data_format module 2016-03-22 22:46:04 +01:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
Goffi
e648a967d5 plugin group blog: minor log change 2015-11-25 11:17:29 +01:00
Goffi
90b7282703 plugin group blog: big cleaning 2015-11-25 11:12:51 +01:00
Goffi
6724b696bc plugin XEP-0277, group blog: added item2data trigger + group permission are parsed when receiving a new item 2015-11-25 10:45:22 +01:00
Goffi
08c4e34815 plugin XEP-0277: tags are handled through atom categories 2015-11-24 23:18:32 +01:00
Goffi
721f404803 plugin group blog: group permissions are used if "group*" keys are found in mbdata (in data2entry and comments trigger) 2015-11-24 16:21:18 +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
souliane
dda1628f3d plugin XEP-0277, misc_groupblog: move getGroupBlogsAtom to XEP-0277, rename to mbGetAtom 2015-09-10 15:06:01 +02:00
Goffi
11acf009ee plugin groupblog: item access availability on serveur is checked on profile connection, and getFeatures is filled accordingly (with "available" key) 2015-08-25 16:51:00 +02:00
Goffi
fe5cc0ac0a plugin groupblog: groupblog compatible pubsub service is checked in profileConected + getFeatures implementation 2015-08-21 19:23:14 +02:00
Goffi
b7409e0488 plugins xep-0060, xep-0163, xep-0277, groupblog: bloging improvments (huge patch, sorry):
/!\ not everything is working yet, and specially groupblogs are broken /!\
    - renamed bridge api to use prefixed methods (e.g. psSubscribeToMany instead of subscribeToMany in PubSub)
    - (xep-0060): try to find a default PubSub service, and put it in client.pubsub_service
    - (xep-0060): extra dictionary can be used in bridge method for RSM and other options
    - (xep-0060): XEP_0060.addManagedNode and XEP_0060.removeManagedNode allow to easily catch notifications for a specific node
    - (xep-0060): retractItem manage "notify" attribute
    - (xep-0060): new signal psEvent will be used to transmit notifications to frontends
    - (xep-0060, constants): added a bunch of useful constants
    - (xep-0163): removed personalEvent in favor of psEvent
    - (xep-0163): addPEPEvent now filter non PEP events for in_callback
    - (xep-0277): use of new XEP-0060 plugin's addManagedNode
    - (xep-0277): fixed author handling for incoming blogs: author is the human readable name, author_jid it jid, and author_jid_verified is set to True is the jid is checked
    - (xep-0277): reworked data2entry with Twisted instead of feed, item_id can now be specified, <content/> is changed to  <title/> if there is only content
    - (xep-0277): comments are now managed here (core removed from groupblog)
    - (xep-0277): (comments) node is created if needed, default pubsub service is used if available, else PEP
    - (xep-0277): retract is managed
2015-08-16 00:39:44 +02:00
Goffi
1e21730bfe plugin XEP-0277: added mBGetFromManyWithComments to have items + comments in one method call 2015-08-15 22:24:38 +02:00
Goffi
c3e34047b2 plugin xep-0060,xep-0277: added getFromMany using new RTDeferredSession mechanism 2015-08-15 22:22:34 +02:00
Goffi
2b20bff614 plugins xep-0277, groupblog: added subscriteToMany to replace massiveSubscribeGroupBlogs + added SatRosterProtocol.getJidsSet 2015-08-15 22:20:43 +02:00
souliane
3595d2656b plugin misc_groupblog: pubsub response do not fail when target server doesn't handle RSM 2015-07-14 16:44:15 +02:00
Goffi
af3ec67047 core (tests): fixed bad use of reserved name 2015-04-23 15:16:06 +02:00
Goffi
13ed04b83d plugin groupblog, tmp (mam, rsm): some style improvments/fixes:
- renamed variables nammed after reserved word/module
    - removed class variables which are not needed
    - removed external parenthesis from asserts
    - in mam.MAMPrefs, removed default value for default argument, as None can't be used
    - (groupblog) extended docstring for DeferredItems and DeferredItemsFromMany
2015-04-23 13:35:21 +02:00
Goffi
9a3fd0c2b3 plugins groupblog, xep-0060: first pass of simplification 2015-04-22 20:21:55 +02:00
Goffi
59d21b93d1 plugins (groupblog, xep-0277) + tmp(rsm): improved style:
- removed external parenthesis in assertions
    - added blank line after first line of docstrings
    - replaced "__" prefixes by "_"
    - renamed variabled named after the reserverd word "max" to "max_"
2015-04-22 18:30:28 +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
souliane
0bb673aa64 plugin groupblog: fixes bad errback default value 2015-01-30 14:08:01 +01:00
souliane
303b58cb03 plugin groupblog: fixes bad errback value 2015-01-09 10:44:37 +01:00
souliane
f3b7bd1ec2 plugins XEP-0060, XEP-0277, groupblog: make use of RSM (XEP-0059) 2014-12-15 14:04:19 +01:00
souliane
dd0c7fab68 plugins groupblogs: fixes the massive retrieval callback (loop variable was misused in a lambda callback) 2014-10-19 02:48:11 +02:00
souliane
97630ccab9 plugin XEP-0277, groupblog: fixes namespace issue of the items that are received from an event + trap some errors 2014-10-06 17:25:41 +02:00
souliane
812e0660a2 plugin XEP-0060, groupblog: avoid unecessary pubsub errors while doing massive requests:
- don't try to retrieve items from non accessible nodes
    - don't try to subscribe to non accessible or already subscribed nodes
2014-09-22 20:49:13 +02:00
souliane
2a0857fe4f plugin groupblog: fixes return value of getLastGroupBlogsAtom when an error occured 2014-09-08 16:53:41 +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
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
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
souliane
f6673e0725 plugin account, groupblog: user can erase all their microblogs at once 2014-03-27 02:24: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
souliane
528ceb5f8b plugin groupblog: added a convenient bridge method getGroupBlogsWithComments 2014-02-28 11:19:08 +01:00
souliane
2b2fa9fd4a plugin XEP-0060, groupblog: added nodeIdentifiers attribute to getItems in order to retrieve items by ids 2014-02-25 17:49:15 +01:00
souliane
c2408dc57d plugin groupblog: bug fix for the atom feed 2014-02-24 12:21:59 +01:00
souliane
8335f92c87 plugins groupblog, XEP-0277: attempt to clarify the code for the comments handling:
- add or update some methods docstrings
- add GroupBlog.__fillCommentsElement to factorize the code responsible to build the comments link
- do not mix up attributes names between the item own service/node and the comments service/node
2014-02-14 21:24:31 +01:00
souliane
daccb7c953 plugin groupblog: do not log error message when asking for the entries of a non existent node (e.g the contact hasn't posted any message yet) 2014-02-18 14:35:30 +01:00
souliane
ff81f76184 plugin groupblog, XEP-0071, XEP-0277, text_syntaxes: manage raw/rich/xhtml data for content/title:
Implementation should follow the following formal specification:

"title" and "content" data can be passed in raw, xhtml or rich format.
When we receive from a frontend a new/updated microblog item:

- keys "title" or "content" have to be escaped (disable HTML tags)
- keys "title_rich" or "content_rich" have to be converted from the current syntax to XHTML
- keys "title_xhtml" or "content_xhtml" have to be cleaned from unwanted XHTML content

Rules to deal with concurrent keys:

- existence of both  "*_xhtml" and "*_rich" keys must raise an exception
- existence of both raw and ("*_xhtml" or "*_rich") is OK

As the storage always need raw data, if it is not given by the user it can be
extracted from the "*_rich" or "*_xhtml" data (remove the XHTML tags).

When a frontend wants to edit a blog post that contains XHTML title or content,
the conversion is made from XHTML to the current user-defined syntax.

- plugin text_syntaxes: added "text" syntax (using lxml)
2014-02-05 16:36:51 +01:00
souliane
5aa76d7d23 plugin groupblog: added method getLastGroupBlogsAtom returns the Atom feed of blog posts 2014-01-22 17:10:28 +01:00
Goffi
2ca6efd8cc dates update 2014-02-04 18:32:49 +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