Develop a specification of API to retrieve logs
API description
Use cases
Channel.Type.MessageArchive
Description
A channel type for logs retrieve. Inspired by Channel.Type.RoomList. Can be used to retrieve logs without opening channels for all possible targets.
Methods
GetMessages (a{sv} filter) -> void
Acceptable filter keys listed in FilterKeys property
Signals
MessagesReceived (aaa{sv}: array of Messages)
MessageHeader part:
- message-sender (u - Contact_Handle) The contact who sent the message. If omitted, clients MUST fall back to looking at message-sender-id.
- message-sender-id (s) The identifier of the contact who sent the message.
- scrollback (b) Must be presented and must be true.
- channel-type (u - Handle_Type) Must be presented.
- target-id (s) The identifier of the target. Must be presented.
Properties
FilterKeys — as
Possible (optional) keys:
- with-id - s (string) Identifier of the contact.
- with-type - (u - Handle_Type) Must be presented, if there is with-id key.
- start-timestamp - x (Unix timestamp)
- end-timestamp - x (Unix timestamp)
- start-message-token - s (Protocol_Message_Token)
- end-message-token - s (Protocol_Message_Token)
- limit - u (uint)
- offset - u (uint)
Channel.Interface.MessageArchive
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
Properties
FilterKeys — as
Possible (optional) keys:
- start-timestamp - x (Unix timestamp)
- end-timestamp - x (Unix timestamp)
- start-message-token - s (Protocol_Message_Token)
- end-message-token - s (Protocol_Message_Token)
- limit - u (uint)
- offset - u (uint)
Links
Exists API
XMPP
XEP-0136: Message Archiving XEP-0313: Message Archive Management
Telegram API
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
messages.getDialogs#6b47f94d offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;
messages.getHistory#8a8ec2da peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
https://core.telegram.org/method/messages.getHistory https://core.telegram.org/method/messages.deleteHistory https://core.telegram.org/method/messages.getDialogs https://core.telegram.org/method/messages.getMessages https://core.telegram.org/method/messages.deleteMessages