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 a specification of API to retrieve logs #8

Open
Kaffeine opened this issue Sep 7, 2016 · 0 comments
Open

Develop a specification of API to retrieve logs #8

Kaffeine opened this issue Sep 7, 2016 · 0 comments

Comments

@Kaffeine
Copy link
Member

Kaffeine commented Sep 7, 2016

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

Report on FreeDesktop.org

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

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

No branches or pull requests

1 participant