diff src/bridge/bridge_constructor/bridge_template.ini @ 1955:633b5c21aefd

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.
author Goffi <goffi@goffi.org>
date Tue, 24 May 2016 22:11:04 +0200
parents 74676624ad5d
children a2bc5089c2eb
line wrap: on
line diff
--- a/src/bridge/bridge_constructor/bridge_template.ini	Mon Apr 18 18:35:19 2016 +0200
+++ b/src/bridge/bridge_constructor/bridge_template.ini	Tue May 24 22:11:04 2016 +0200
@@ -34,17 +34,24 @@
 doc_param_2=groups: Roster's groups where the contact is
 doc_param_3=%(doc_profile)s
 
-[newMessage]
+[messageNew]
 type=signal
 category=core
-sig_in=ssssa{ss}s
+sig_in=sdssa{ss}a{ss}sa{ss}s
 doc=A message has been received
-doc_param_0=from_jid: JID where the message is comming from
-doc_param_1=message: Message itself
-doc_param_2=mess_type: Type of the message (cf RFC 6121 §5.2.2) + C.MESS_TYPE_INFO (system info)
+doc_param_0=uid: unique ID of the message (id specific to SàT, this it *NOT* an XMPP id)
+doc_param_1=timestamp: when the message was sent (or declared sent for delayed messages)
+doc_param_2=from_jid: JID where the message is comming from
 doc_param_3=to_jid: JID where the message must be sent
-doc_param_4=extra: extra message information
-doc_param_5=%(doc_profile)s
+doc_param_4=message: message itself, can be in several languages (key is language code or '' for default)
+doc_param_5=subject: subject of the message, can be in several languages (key is language code or '' for default)
+doc_param_6=mess_type: Type of the message (cf RFC 6121 §5.2.2) + C.MESS_TYPE_INFO (system info)
+doc_param_7=extra: extra message information, can have data added by plugins and/or:
+  - thread: id of the thread
+  - thread_parent: id of the parent of the current thread
+  - received_timestamp: date of receiption for delayed messages
+  - delay_sender: entity which has originally sent or which has delayed the message
+doc_param_8=%(doc_profile)s
 
 [newAlert]
 deprecated=
@@ -434,11 +441,11 @@
 doc_return=List of confirmation request data, same as for [askConfirmation]
 
 
-[sendMessage]
+[messageSend]
 async=
 type=method
 category=core
-sig_in=ssssa{ss}s
+sig_in=sa{ss}a{ss}sa{ss}s
 sig_out=
 param_2_default=''
 param_3_default="auto"
@@ -446,8 +453,10 @@
 param_5_default="@NONE@"
 doc=Send a message
 doc_param_0=to_jid: JID of the recipient
-doc_param_1=message: body of the message
-doc_param_2=subject: Subject of the message ('' if no subject)
+doc_param_1=message: body of the message:
+    key is the language of the body, use '' when unknown
+doc_param_2=subject: Subject of the message
+    key is the language of the subkect, use '' when unknown
 doc_param_3=mess_type: Type of the message (cf RFC 6121 §5.2.2) or "auto" for automatic type detection
 doc_param_4=extra: optional data that can be used by a plugin to build more specific messages 
 doc_param_5=%(doc_profile_key)s
@@ -577,12 +586,12 @@
 doc_param_1=%(doc_security_limit)s
 doc_param_2=app: name of the frontend registering the parameters
 
-[getHistory]
+[historyGet]
 async=
 type=method
 category=core
 sig_in=ssibss
-sig_out=a(dssssa{ss})
+sig_out=a(sdssa{ss}a{ss}sa{ss})
 param_3_default=True
 param_4_default=''
 param_5_default="@NONE@"
@@ -593,7 +602,7 @@
 doc_param_3=between: True if we want history between the two jids (in both direction), False if we only want messages from from_jid to to_jid
 doc_param_4=search: pattern to filter the history results
 doc_param_5=%(doc_profile)s
-doc_return=Ordered list (by timestamp) of tuples (timestamp, full from_jid, full to_jid, message, type, extra)
+doc_return=Ordered list (by timestamp) of data as in [messageNew] (without final profile)
 
 [addContact]
 type=method