Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop Channel.Interface.MessageArchive spec #3

Open
Kaffeine opened this issue Nov 29, 2016 · 0 comments
Open

Develop Channel.Interface.MessageArchive spec #3

Kaffeine opened this issue Nov 29, 2016 · 0 comments

Comments

@Kaffeine
Copy link
Member

Kaffeine commented Nov 29, 2016

Objects implementing this interface must also implement: Channel.Type.Text and Channel.Interface.Messages.

Methods

GetMessages (a{sv} filter) -> void

Acceptable filter keys listed in FilterKeys property

Once the method is called, it emits Channel.Interface.Messages MessageReceived (aa{sv}: Message) signals for received scroll-back messages

Examples

A request for 20 messages after a certain one might be represented as:

{
  'limit': 20,
  'offset': 1, # Skip the known message
  'message-token': '9de9546a-3400-4419-a505-3ea270cb834c',
}

A request for a single message by its token:

{
  'limit': 1,
  'offset': 0, # Can be omitted
  'message-token': '9de9546a-3400-4419-a505-3ea270cb834c',
}

A request for all messages in a certain timespan:

{
  'limit': 0,
  'start-timestamp': 1210123456,
  'end-timestamp': 1210234567,
}

Properties

AvailableFilterKeys — as

List of available filter keys, sorted by preference (more suitable keys listed first).

Types

Message_Filter_Key — s

Possible keys:

  • limit (u) — Maximum number of messages to be returned. Must be supported by all CMs and must be presented in all request. If 0, the number of messages is unlimited.
  • offset (u) — Number of messages to be skipped. Usually goes well with the 'message-token' key.
  • message-token (s - Protocol_Message_Token) — If specified, the connection manager MUST only return messages starting with the referenced one. This key is not compatible with the 'start-timestamp' key.
  • start-timestamp (x - Unix_Timestamp64) — A value to filter out messages before a certain date/time. If specified, the connection manager MUST only return messages whose timestamp is equal to or later than the given timestamp.
  • end-timestamp (x - Unix_Timestamp64) — A value to filter out messages after a certain date/time. If specified, the connection manager MUST only return messages whose timestamp is equal to or earlier than the given timestamp.

Implementation

Work in progress:

https://github.com/TelepathyIM/telepathy-qt/commits/MessageArchive
https://github.com/TelepathyIM/telepathy-morse/commits/MessageArchive (Telegram CM)
https://cgit.kde.org/scratch/akulichalexandr/ktp-common-internals.git/log/?h=MessageArchive (KDE client)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant