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-27 16:42:48 +00:00
|
|
|
dictionary MessagePreview {
|
|
|
|
string sender;
|
|
|
|
string text;
|
|
|
|
timestamp date;
|
|
|
|
MessageAck ack;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary Dialog {
|
|
|
|
string id;
|
|
|
|
string title;
|
|
|
|
MessagePreview? lastMessage;
|
|
|
|
boolean pinned;
|
|
|
|
};
|
|
|
|
|
2022-10-27 15:38:46 +00:00
|
|
|
namespace talaria {
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
void initDatabase(string path);
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
void initClient();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
boolean needLogin();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
u64 requestLoginCode(string phone);
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
void signIn(u64 tokenPtr, string code);
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 16:42:48 +00:00
|
|
|
sequence<Dialog> getDialogs();
|
2022-10-27 17:33:35 +00:00
|
|
|
[Throws=NativeError]
|
2022-10-27 15:38:46 +00:00
|
|
|
void sendMessage(string packed, string text);
|
|
|
|
};
|