TelegramTUI/inc/message.h

55 lines
1021 B
C++

#pragma once
#include <cstdint>
#include <string>
#include <memory>
#include "replymarkup.h"
enum class MessageType : uint32_t {
UNKNOWN = 0,
UNSUPPORTED = 1,
TEXT = 2,
ANIMATION,
AUDIO,
CONTACT,
DOCUMENT,
LOCATION,
PHOTO,
POLL,
STICKER,
VIDEO,
VENUE,
VOICE,
SERVICE
};
const std::string MessageTypeTypes[] {"unknown", "unsupported", "text", "animation", "audio", "contact", "document", "location", "photo", "poll", "sticker", "video", "venue", "voice", "service"};
const std::string& convertMessageType(MessageType);
MessageType convertMessageType(const std::string& in);
struct Message {
int64_t id;
int64_t chat;
int64_t sender;
MessageType type;
std::string text;
bool isDeleted;
bool isOutgoing;
bool isPinned;
bool isEditable;
bool isForwardable;
uint64_t sendDate;
uint64_t editDate;
int64_t messageThreadId;
int64_t viaBotid;
int64_t mediaAlbumId;
std::shared_ptr<ReplyMarkup> replyMarkup;
bool operator==(const Message&) const;
bool operator!=(const Message&) const;
};