On Sunday 11 June 2017 20:22:24 Pali Rohár wrote: > On Sunday 11 June 2017 19:25:52 Paulo Lieuthier wrote: > > > Plus there is missing something like "session" information. E.g. in > > > jabber you can communicate with one person in more one-to-one > > > chats. Every one is identified by jabber roster. Moreover some > > > jabber XEP extension supports some another session identifier > > > which is not bound to roster. > > > > Could you please expand on that? I'm not following. A real example or > > documentation would help me a lot. > > Every jabber message is sent from pair (local_user_id, local_roster) to > pair (remote_user_id, remote_roster). Roster is string identification > needed when you connect to your account from multiple clients at same > time. E.g. target user is connected from both laptop and mobile and you > want to send message to his laptop (not mobile). > > So it would be nice to be able to also distinguish where were messages > sent, but still able to query all messages for particular user. > > For other protocols there can be session information (e.g. string) to > group some messages together. E.g. messages which was sent from one > window until both side closed conversation.
Some more details: For 1:1 conversations we have those attributes: * from which contact is message sent - contact identifier (e.g. email address, jabber JID, ICQ number, IRC nick) - contact display name - client/computer identifier (e.g. roster in jabber; in case it is possible to distinguish between multiple clients connected at some time from more devices) - session identifier (in case it is possible to have "more" chat windows with same person at same time) * to which contact is message sent - (same properties as for "from") * account via which this message was sent (e.g. jabber JID, ICQ number, IRC server identifier -- Freenode, ...) * message body (HTML), maybe subject of message? * additional attributes (like state, importance, encryption/signature, etc.) And as (SQL?) query for messages which belongs to one contact in 1:1 conversations needs to be simple, I suggest to store "other" side of conversation into same column. So not to have "from" and "to", but rather "local side", "remote side" and "direction". For multi group conversations we have: One required attribute: * sender of message (again consist of what is in "from" for 1:1 conversations) And many optional: * human readable identifier of target (room name, e.g. IRC channel, jabber JID of conference) * machine identifier of group chat (e.g. some arbitrary string in skype) * list of receivers of message (again may consist of what is in "from" for 1:1) * topic of group conversation And same message body/subject/account... attributes as for 1:1. When thinking about it, things like "session identifier" or "client/computer" identifier may not be defined/set and for some protocols they are even not supported (e.g. ICQ). -- Pali Rohár pali.ro...@gmail.com