anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
memo.h (1193B)
1 /* 2 * 3 * (C) 2003-2022 Anope Team 4 * Contact us at team@anope.org 5 * 6 * Please read COPYING and README for further details. 7 * 8 * Based on the original code of Epona by Lara. 9 * Based on the original code of Services by Andy Church. 10 */ 11 12 #ifndef MEMO_H 13 #define MEMO_H 14 15 #include "anope.h" 16 #include "serialize.h" 17 18 class CoreExport Memo : public Serializable 19 { 20 public: 21 MemoInfo *mi; 22 bool unread; 23 bool receipt; 24 Memo(); 25 ~Memo(); 26 27 void Serialize(Serialize::Data &data) const anope_override; 28 static Serializable* Unserialize(Serializable *obj, Serialize::Data &); 29 30 Anope::string owner; 31 /* When it was sent */ 32 time_t time; 33 Anope::string sender; 34 Anope::string text; 35 }; 36 37 /* Memo info structures. Since both nicknames and channels can have memos, 38 * we encapsulate memo data in a MemoInfo to make it easier to handle. 39 */ 40 struct CoreExport MemoInfo 41 { 42 int16_t memomax; 43 Serialize::Checker<std::vector<Memo *> > memos; 44 std::vector<Anope::string> ignores; 45 46 MemoInfo(); 47 Memo *GetMemo(unsigned index) const; 48 unsigned GetIndex(Memo *m) const; 49 void Del(unsigned index); 50 bool HasIgnore(User *u); 51 52 static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan); 53 }; 54 55 #endif // MEMO_H