Anope IRC Services  Version 2.0
memo.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) 2003-2014 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 
13 #ifndef MEMO_H
14 #define MEMO_H
15 
16 #include "anope.h"
17 #include "serialize.h"
18 
20 {
21  public:
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 
31  /* When it was sent */
32  time_t time;
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  */
41 {
42  int16_t memomax;
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
Anope::string text
Definition: memo.h:34
Anope::string sender
Definition: memo.h:33
Definition: users.h:34
bool receipt
Definition: memo.h:23
Definition: memo.h:40
std::vector< Anope::string > ignores
Definition: memo.h:44
Definition: memo.h:19
virtual void Serialize(Serialize::Data &data) const =0
#define anope_override
Definition: services.h:56
int16_t memomax
Definition: memo.h:42
#define CoreExport
Definition: services.h:62
Serialize::Checker< std::vector< Memo * > > memos
Definition: memo.h:43
time_t time
Definition: memo.h:32
bool unread
Definition: memo.h:22
Anope::string owner
Definition: memo.h:30