comparison src/bridge/bridge_constructor/bridge_template.ini @ 2144:1d3f73e065e1

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
author Goffi <goffi@goffi.org>
date Sun, 12 Feb 2017 17:55:43 +0100
parents be96beb7ca14
children 1bb9bf1b4150
comparison
equal deleted inserted replaced
2143:c3cac21157d4 2144:1d3f73e065e1
234 doc_param_1=keys: list of keys to get 234 doc_param_1=keys: list of keys to get
235 doc_param_2=%(doc_profile)s 235 doc_param_2=%(doc_profile)s
236 doc_return=dictionary with jids as keys and dictionary of asked key as values 236 doc_return=dictionary with jids as keys and dictionary of asked key as values
237 if key doesn't exist for a jid, the resulting dictionary will not have it 237 if key doesn't exist for a jid, the resulting dictionary will not have it
238 238
239 [asyncCreateProfile] 239 [profileCreate]
240 async= 240 async=
241 type=method 241 type=method
242 category=core 242 category=core
243 sig_in=ss 243 sig_in=sss
244 sig_out= 244 sig_out=
245 param_1_default='' 245 param_1_default=''
246 param_2_default=''
246 doc=Create a new profile 247 doc=Create a new profile
247 doc_param_0=%(doc_profile)s 248 doc_param_0=%(doc_profile)s
248 doc_param_1=password: password of the profile 249 doc_param_1=password: password of the profile
250 doc_param_2=component: set to component entry point if it is a component, else use empty string
249 doc_return=callback is called when profile actually exists in database and memory 251 doc_return=callback is called when profile actually exists in database and memory
250 errback is called with error constant as parameter: 252 errback is called with error constant as parameter:
251 - ConflictError: the profile name already exists 253 - ConflictError: the profile name already exists
252 - CancelError: profile creation canceled 254 - CancelError: profile creation canceled
255 - NotFound: component entry point is not available
253 256
254 [asyncDeleteProfile] 257 [asyncDeleteProfile]
255 async= 258 async=
256 type=method 259 type=method
257 category=core 260 category=core
306 param_0_default="@DEFAULT@" 309 param_0_default="@DEFAULT@"
307 doc=Tell if a profile session is loaded 310 doc=Tell if a profile session is loaded
308 doc_param_0=%(doc_profile_key)s 311 doc_param_0=%(doc_profile_key)s
309 312
310 [disconnect] 313 [disconnect]
314 async=
311 type=method 315 type=method
312 category=core 316 category=core
313 sig_in=s 317 sig_in=s
314 sig_out= 318 sig_out=
315 param_0_default="@DEFAULT@" 319 param_0_default="@DEFAULT@"