TelepathyIM / telepathy-spec

Telepathy D-Bus API specification
https://telepathy.freedesktop.org/spec/
GNU Lesser General Public License v2.1
2 stars 0 forks source link

Develop Channel.Interface.MessageArchive spec #3

Open Kaffeine opened 7 years ago

Kaffeine commented 7 years ago

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:

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)