summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-27 22:29:34 -0400
committerAdam <Adam@anope.org>2010-10-27 22:29:34 -0400
commita26f119bc8666642a54564763626e52e5c72b030 (patch)
treedbc5a6e06105c4111338d61a8739c4ea9c951e1b /include
parenta79da4bba11ef6fec0ef010a7900c742c2e358ad (diff)
Do not store memo number in memo structs, fixes some bugs with deleting memos
Diffstat (limited to 'include')
-rw-r--r--include/extern.h1
-rw-r--r--include/modules.h6
-rw-r--r--include/services.h5
3 files changed, 8 insertions, 4 deletions
diff --git a/include/extern.h b/include/extern.h
index fe6fe7546..496c1caca 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -207,7 +207,6 @@ E void rsend_notify(User *u, Memo *m, const Anope::string &chan);
E void check_memos(User *u);
E MemoInfo *getmemoinfo(const Anope::string &name, bool &ischan, bool &isforbid);
E void memo_send(User *u, const Anope::string &name, const Anope::string &text, int z);
-E bool delmemo(MemoInfo *mi, unsigned num);
/**** messages.c ****/
diff --git a/include/modules.h b/include/modules.h
index e47b5612b..7a0d02269 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -939,16 +939,18 @@ class CoreExport Module : public virtual Base
/** Called when a memo is deleted
* @param nc The nickcore of the memo being deleted
* @param mi The memo info
+ * @param m The memo
* @param number What memo number is being deleted, can be 0 for all memos
*/
- virtual void OnMemoDel(const NickCore *nc, MemoInfo *mi, int number) { }
+ virtual void OnMemoDel(const NickCore *nc, MemoInfo *mi, Memo *m) { }
/** Called when a memo is deleted
* @param ci The channel of the memo being deleted
* @param mi The memo info
+ * @param m The memo
* @param number What memo number is being deleted, can be 0 for all memos
*/
- virtual void OnMemoDel(ChannelInfo *ci, MemoInfo *mi, int number) { }
+ virtual void OnMemoDel(ChannelInfo *ci, MemoInfo *mi, Memo *m) { }
/** Called when a mode is set on a channel
* @param c The channel
diff --git a/include/services.h b/include/services.h
index 50ea809a6..fd4cc80ee 100644
--- a/include/services.h
+++ b/include/services.h
@@ -477,7 +477,6 @@ enum MemoFlag
class Memo : public Flags<MemoFlag>
{
public:
- uint32 number; /* Index number -- not necessarily array position! */
time_t time; /* When it was sent */
Anope::string sender;
Anope::string text;
@@ -487,6 +486,10 @@ struct MemoInfo
{
unsigned memomax;
std::vector<Memo *> memos;
+
+ unsigned GetIndex(Memo *m) const;
+ void Del(unsigned index);
+ void Del(Memo *m);
};
/*************************************************************************/