forked from ars3niy/tdlib-purple
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsticker.h
41 lines (34 loc) · 1.46 KB
/
sticker.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
#ifndef _STICKER_H
#define _STICKER_H
#include "client-utils.h"
void showWebpSticker(const td::td_api::chat &chat, const TgMessageInfo &message,
const std::string &filePath, const std::string &fileDescription,
TdAccountData &account);
class StickerConversionThread: public AccountThread {
private:
std::string m_errorMessage;
std::string m_outputFileName;
void run() override;
static Callback g_callback;
void callback(PurpleTdClient *tdClient) override;
TgMessageInfo m_message;
public:
const std::string inputFileName;
const ChatId chatId;
StickerConversionThread(PurpleAccount *purpleAccount, const std::string &filename,
ChatId chatId, TgMessageInfo &&message)
: AccountThread(purpleAccount), m_message(std::move(message)), inputFileName(filename),
chatId(chatId) {}
StickerConversionThread(PurpleAccount *purpleAccount, const std::string &filename,
ChatId chatId, const TgMessageInfo *message)
: AccountThread(purpleAccount), inputFileName(filename), chatId(chatId)
{
if (message)
m_message.assign(*message);
}
const std::string &getOutputFileName() const { return m_outputFileName; }
const std::string &getErrorMessage() const { return m_errorMessage; }
const TgMessageInfo &message() const { return m_message; }
static void setCallback(Callback callback);
};
#endif