forked from ars3niy/tdlib-purple
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathreceiving.h
59 lines (51 loc) · 3.45 KB
/
receiving.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef _RECEIVING_H
#define _RECEIVING_H
#include "account-data.h"
#include <purple.h>
std::string makeNoticeWithSender(const td::td_api::chat &chat, const TgMessageInfo &message,
const char *noticeText, PurpleAccount *account);
std::string getMessageText(const td::td_api::formattedText &text);
std::string makeInlineImageText(int imgstoreId);
void sendConversationReadReceipts(TdAccountData &account, PurpleConversation *conv);
void showMessageText(TdAccountData &account, const td::td_api::chat &chat, const TgMessageInfo &message,
const char *text, const char *notification, uint32_t extraFlags = 0);
void showMessageTextIm(TdAccountData &account, const char *purpleUserName, const char *text,
const char *notification, time_t timestamp, PurpleMessageFlags flags);
void showChatNotification(TdAccountData &account, const td::td_api::chat &chat,
const char *notification, PurpleMessageFlags extraFlags = (PurpleMessageFlags)0);
void showChatNotification(TdAccountData &account, const td::td_api::chat &chat,
const char *notification, time_t timestamp, PurpleMessageFlags extraFlags);
void showGenericFileInline(const td::td_api::chat &chat, const TgMessageInfo &message,
const std::string &filePath, const char *caption,
const std::string &fileDescription,TdAccountData &account);
void showDownloadedFileInline(ChatId chatId, TgMessageInfo &message,
const std::string &filePath, const char *caption,
const std::string &fileDescription,
td::td_api::object_ptr<td::td_api::file> thumbnail,
TdTransceiver &transceiver, TdAccountData &account);
bool isStickerAnimated(const std::string &filePath);
bool shouldConvertAnimatedSticker(const TgMessageInfo &message, const PurpleAccount *purpleAccount);
void showMessage(const td::td_api::chat &chat, IncomingMessage &fullMessage,
TdTransceiver &transceiver, TdAccountData &account);
void showMessages(std::vector<IncomingMessage>& messages, TdAccountData &account);
struct FileInfo {
const td::td_api::file *file;
std::string name;
std::string caption;
std::string description;
bool secret;
};
const td::td_api::file *selectPhotoSize(PurpleAccount *account, const td::td_api::messagePhoto &photo);
void getFileFromMessage(const IncomingMessage &fullMessage, FileInfo &result);
void makeFullMessage(const td::td_api::chat &chat, td::td_api::object_ptr<td::td_api::message> message,
IncomingMessage &fullMessage, const TdAccountData &account);
bool isMessageReady(const IncomingMessage &fullMessage, const TdAccountData &account);
void fetchExtras(IncomingMessage &fullMessage, TdTransceiver &transceiver, TdAccountData &account,
TdTransceiver::ResponseCb2 onFetchReply);
void checkMessageReady(const IncomingMessage *message, TdTransceiver &transceiver,
TdAccountData &account, std::vector<IncomingMessage> *rvReadyMessages = nullptr);
void handleIncomingMessage(TdAccountData &account, const td::td_api::chat &chat,
td::td_api::object_ptr<td::td_api::message> message,
PendingMessageQueue::MessageAction action);
void fetchHistory(TdAccountData &account, ChatId chatId, MessageId fetchFrom, MessageId stopAt);
#endif