2022-10-27 17:33:35 +00:00
|
|
|
[Error]
|
|
|
|
enum NativeError {
|
|
|
|
"Initialization",
|
|
|
|
"Database",
|
|
|
|
"Network",
|
|
|
|
};
|
|
|
|
|
2022-10-27 16:08:57 +00:00
|
|
|
enum MessageAck {
|
|
|
|
"Received",
|
|
|
|
"Seen",
|
|
|
|
"Sent",
|
|
|
|
};
|
|
|
|
|
2022-10-29 11:06:38 +00:00
|
|
|
enum Formatting {
|
|
|
|
"Unknown",
|
|
|
|
"Mention",
|
|
|
|
"HashTag",
|
|
|
|
"BotCommand",
|
|
|
|
"Url",
|
|
|
|
"Email",
|
|
|
|
"Bold",
|
|
|
|
"Italic",
|
|
|
|
"Code",
|
|
|
|
"Pre", // language:string
|
|
|
|
"TextUrl", // url:string
|
|
|
|
"MentionName", // user_id:long
|
|
|
|
"Phone",
|
|
|
|
"CashTag",
|
|
|
|
"Underline",
|
|
|
|
"Strike",
|
|
|
|
"Blockquote",
|
|
|
|
"BankCard",
|
|
|
|
"Spoiler",
|
|
|
|
"CustomEmoji", // document_id:long
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary TextFormat {
|
|
|
|
Formatting format;
|
|
|
|
i32 offset;
|
|
|
|
i32 length;
|
|
|
|
string? extra;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary Message {
|
|
|
|
i32 id;
|
|
|
|
string sender;
|
|
|
|
string text;
|
|
|
|
timestamp date;
|
|
|
|
timestamp? edit_date;
|
|
|
|
sequence<TextFormat> formatting;
|
|
|
|
};
|
|
|
|
|
2022-10-27 16:42:48 +00:00
|
|
|
dictionary MessagePreview {
|
|
|
|
string sender;
|
|
|
|
string text;
|
|
|
|
timestamp date;
|
|
|
|
MessageAck ack;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary Dialog {
|
|
|
|
string id;
|
|
|
|
string title;
|
2022-10-27 17:48:29 +00:00
|
|
|
MessagePreview? last_message;
|
2022-10-27 16:42:48 +00:00
|
|
|
boolean pinned;
|
|
|
|
};
|
|
|
|
|
2022-10-27 18:12:41 +00:00
|
|
|
interface LoginProcedure {
|
|
|
|
constructor();
|
|
|
|
[Throws=NativeError]
|
|
|
|
void request_login_code(string phone);
|
|
|
|
[Throws=NativeError]
|
|
|
|
void sign_in(string code);
|
|
|
|
};
|
|
|
|
|
2022-10-27 15:38:46 +00:00
|
|
|
namespace talaria {
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 17:48:29 +00:00
|
|
|
void init_database(string path);
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 17:48:29 +00:00
|
|
|
void init_client();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 17:48:29 +00:00
|
|
|
boolean need_login();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 17:48:29 +00:00
|
|
|
sequence<Dialog> get_dialogs();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-29 11:06:38 +00:00
|
|
|
sequence<Message> get_messages(string packed);
|
|
|
|
[Throws=NativeError]
|
|
|
|
Message send_message(string packed, string text);
|
2022-10-27 15:38:46 +00:00
|
|
|
};
|