2020-05-25 23:21:04 +02:00
|
|
|
#ifndef _PURPLE_INFO_H
|
|
|
|
#define _PURPLE_INFO_H
|
2020-05-22 14:48:17 +02:00
|
|
|
|
2020-10-04 15:17:04 +02:00
|
|
|
#include "identifiers.h"
|
2020-05-09 14:07:21 +02:00
|
|
|
#include <purple.h>
|
|
|
|
#include <td/telegram/td_api.h>
|
|
|
|
|
2020-05-22 14:48:17 +02:00
|
|
|
static constexpr int
|
|
|
|
GROUP_TYPE_BASIC = 1,
|
|
|
|
GROUP_TYPE_SUPER = 2,
|
|
|
|
GROUP_TYPE_CHANNEL = 3;
|
|
|
|
|
2020-06-13 16:01:05 +02:00
|
|
|
class PurpleTdClient;
|
|
|
|
|
2020-06-11 00:04:29 +02:00
|
|
|
const char *getChatNameComponent();
|
2020-05-09 14:07:21 +02:00
|
|
|
GList *getChatJoinInfo();
|
2020-06-11 00:04:29 +02:00
|
|
|
std::string getPurpleChatName(const td::td_api::chat &chat);
|
2020-05-09 14:07:21 +02:00
|
|
|
GHashTable *getChatComponents(const td::td_api::chat &chat);
|
2020-05-22 14:48:17 +02:00
|
|
|
|
2020-05-10 12:05:55 +02:00
|
|
|
const char *getChatName(GHashTable *components);
|
2020-08-13 13:34:23 +02:00
|
|
|
const char *getChatJoinString(GHashTable *components);
|
2020-05-22 14:48:17 +02:00
|
|
|
const char *getChatGroupName(GHashTable *components);
|
|
|
|
int getChatGroupType(GHashTable *components);
|
|
|
|
|
2020-10-04 15:17:04 +02:00
|
|
|
ChatId getTdlibChatId(const char *chatName);
|
2020-05-22 14:48:17 +02:00
|
|
|
|
2020-05-26 20:06:09 +02:00
|
|
|
namespace AccountOptions {
|
|
|
|
constexpr const char *AutoDownloadLimit = "media-size-threshold";
|
|
|
|
constexpr const char *AutoDownloadLimitDefault = "32";
|
|
|
|
constexpr const char *BigDownloadHandling = "media-handling-behavior";
|
|
|
|
constexpr const char *BigDownloadHandlingAsk = "ask";
|
|
|
|
constexpr const char *BigDownloadHandlingDiscard = "discard";
|
2020-05-31 15:55:28 +02:00
|
|
|
constexpr const char *BigDownloadHandlingDefault = BigDownloadHandlingAsk;
|
2020-10-05 21:40:09 +02:00
|
|
|
constexpr const char *EnableSecretChats = "enable-secret-chats";
|
|
|
|
constexpr gboolean EnableSecretChatsDefault = TRUE;
|
2020-06-13 16:01:05 +02:00
|
|
|
constexpr const char *AnimatedStickers = "animated-stickers";
|
|
|
|
constexpr gboolean AnimatedStickersDefault = TRUE;
|
2020-08-14 21:44:38 +02:00
|
|
|
constexpr const char *DownloadBehaviour = "download-behaviour";
|
|
|
|
constexpr const char *DownloadBehaviourHyperlink = "hyperlink";
|
|
|
|
constexpr const char *DownloadBehaviourStandard = "file-transfer";
|
|
|
|
const char *DownloadBehaviourDefault();
|
2020-10-18 17:23:00 +02:00
|
|
|
constexpr const char *KeepInlineDownloads = "keep-inline-downloads";
|
|
|
|
constexpr gboolean KeepInlineDownloadsDefault = FALSE;
|
2020-05-26 20:06:09 +02:00
|
|
|
};
|
|
|
|
|
2020-06-04 22:57:01 +02:00
|
|
|
namespace BuddyOptions {
|
|
|
|
constexpr const char *ProfilePhotoId = "tdlib-profile-photo-id";
|
|
|
|
};
|
|
|
|
|
2020-05-26 20:06:09 +02:00
|
|
|
unsigned getAutoDownloadLimitKb(PurpleAccount *account);
|
|
|
|
bool isSizeWithinLimit(unsigned size, unsigned limit);
|
|
|
|
bool ignoreBigDownloads(PurpleAccount *account);
|
2020-06-13 16:01:05 +02:00
|
|
|
PurpleTdClient *getTdClient(PurpleAccount *account);
|
2020-08-14 21:44:38 +02:00
|
|
|
const char *getUiName();
|
2020-05-26 20:06:09 +02:00
|
|
|
|
2020-05-22 14:48:17 +02:00
|
|
|
#endif
|