44 lines
818 B
Plaintext
44 lines
818 B
Plaintext
[Error]
|
|
enum NativeError {
|
|
"Initialization",
|
|
"Database",
|
|
"Network",
|
|
};
|
|
|
|
enum MessageAck {
|
|
"Received",
|
|
"Seen",
|
|
"Sent",
|
|
};
|
|
|
|
dictionary MessagePreview {
|
|
string sender;
|
|
string text;
|
|
timestamp date;
|
|
MessageAck ack;
|
|
};
|
|
|
|
dictionary Dialog {
|
|
string id;
|
|
string title;
|
|
MessagePreview? last_message;
|
|
boolean pinned;
|
|
};
|
|
|
|
namespace talaria {
|
|
[Throws=NativeError]
|
|
void init_database(string path);
|
|
[Throws=NativeError]
|
|
void init_client();
|
|
[Throws=NativeError]
|
|
boolean need_login();
|
|
[Throws=NativeError]
|
|
u64 request_login_code(string phone);
|
|
[Throws=NativeError]
|
|
void sign_in(u64 tokenPtr, string code);
|
|
[Throws=NativeError]
|
|
sequence<Dialog> get_dialogs();
|
|
[Throws=NativeError]
|
|
void send_message(string packed, string text);
|
|
};
|