27 lines
579 B
C++
27 lines
579 B
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <nlohmann/json_fwd.hpp>
|
|
using json = nlohmann::json;
|
|
|
|
struct Message {
|
|
int64_t chatid = 0;
|
|
int64_t messageid = 0;
|
|
int64_t senderid = 0;
|
|
std::string fwdFrom;
|
|
std::string text = "";
|
|
std::string filename = ""; //empty filename = no file
|
|
time_t date = 0;
|
|
bool isreply = false;
|
|
|
|
Message() {}
|
|
Message(const json& j, int64_t chatid);
|
|
|
|
bool operator==(const Message& m) const;
|
|
bool operator!=(const Message& m) const;
|
|
bool operator<(const Message& m) const;
|
|
|
|
bool hasFile() const;
|
|
std::string getDate() const;
|
|
};
|