1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

BUILD : 1.7.2 (80) BUGS : N/A NOTES : Added Memos/ChannelInfo to the moduleAddData() system

git-svn-id: svn://svn.anope.org/anope/trunk@80 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@56 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-05-02 10:34:58 +00:00
parent 7250a369ab
commit c5cb6ef9fe
7 changed files with 38 additions and 6 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
Anope Version 1.7.x (will be renamed when next release is produced)
-------------------
Provided by Anope Dev. <dev@anope.org>
2004/05/02 Added NickCore and NickAlias to the moduleAddData stuff, its going well!
2004/05/02 Added NickCore,NickAlias,Memos,ChannelInfo to the moduleAddData stuff, its going well!
2004/04/29 Added new MemoServ command CHECK to check whether a memo has been read or not.
2004/04/26 Added module data ability, currently only added to User struct
2004/04/23 Added new MemoServ command RSEND to send a memo requesting a receipt memo once the recipient reads it.
+4
View File
@@ -2182,6 +2182,7 @@ int delchan(ChannelInfo * ci)
for (i = 0; i < ci->memos.memocount; i++) {
if (ci->memos.memos[i].text)
free(ci->memos.memos[i].text);
moduleCleanStruct(ci->memos.memos[i].moduleData);
}
free(ci->memos.memos);
}
@@ -2193,6 +2194,9 @@ int delchan(ChannelInfo * ci)
}
if (ci->badwords)
free(ci->badwords);
moduleCleanStruct(ci->moduleData);
free(ci);
if (nc)
nc->channelcount--;
+4 -1
View File
@@ -192,6 +192,7 @@ static int delmemo(MemoInfo * mi, int num)
break;
}
if (i < mi->memocount) {
moduleCleanStruct(mi->memos[i].moduleData);
free(mi->memos[i].text); /* Deallocate memo text memory */
mi->memocount--; /* One less memo now */
if (i < mi->memocount) /* Move remaining memos down a slot */
@@ -778,8 +779,10 @@ static int do_del(User * u)
notice_lang(s_MemoServ, u, MEMO_DELETED_ONE, last);
} else {
/* Delete all memos. */
for (i = 0; i < mi->memocount; i++)
for (i = 0; i < mi->memocount; i++) {
free(mi->memos[i].text);
moduleCleanStruct(mi->memos[i].moduleData);
}
free(mi->memos);
mi->memos = NULL;
mi->memocount = 0;
+19 -1
View File
@@ -1939,10 +1939,12 @@ void moduleDelAllData(ModuleData * md[])
void moduleDelAllDataMod(Module * m)
{
boolean freeme = false;
int i;
int i, j;
User *user;
NickAlias *na;
NickCore *nc;
ChannelInfo *ci;
if (!mod_current_module_name) {
mod_current_module_name = sstrdup(m->name);
freeme = true;
@@ -1956,12 +1958,28 @@ void moduleDelAllDataMod(Module * m)
/* Remove the nick Cores */
for (nc = nclists[i]; nc; nc = nc->next) {
moduleDelAllData(nc->moduleData);
/* Remove any memo data for this nick core */
for (j = 0; j < nc->memos.memocount; j++) {
moduleCleanStruct(nc->memos.memos[j].moduleData);
}
}
/* Remove the nick Aliases */
for (na = nalists[i]; na; na = na->next) {
moduleDelAllData(na->moduleData);
}
}
for (i = 0; i < 256; i++) {
/* Remove any chan info data */
for (ci = chanlists[i]; ci; ci = ci->next) {
moduleDelAllData(ci->moduleData);
/* Remove any memo data for this nick core */
for (j = 0; j < ci->memos.memocount; j++) {
moduleCleanStruct(ci->memos.memos[j].moduleData);
}
}
}
if (freeme) {
free(mod_current_module_name);
mod_current_module_name = NULL;
+2 -2
View File
@@ -1514,14 +1514,14 @@ static int delcore(NickCore * nc)
if (nc->memos.memos) {
for (i = 0; i < nc->memos.memocount; i++) {
if (nc->memos.memos[i].text)
free(nc->memos.memos[i].text);
moduleCleanStruct(nc->memos.memos[i].moduleData);
free(nc->memos.memos[i].text);
}
free(nc->memos.memos);
}
moduleCleanStruct(nc->moduleData);
free(nc);
return 1;
+3
View File
@@ -219,6 +219,7 @@ struct memo_ {
time_t time; /* When it was sent */
char sender[NICKMAX];
char *text;
ModuleData *moduleData[1024]; /* Module saved data attached to the Memo */
};
#define MF_UNREAD 0x0001 /* Memo has not yet been read */
@@ -502,6 +503,8 @@ struct chaninfo_ {
struct channel_ *c; /* Pointer to channel record (if *
* channel is currently in use) */
ModuleData *moduleData[1024]; /* Module saved data attached to the ChannelInfo */
/* For BotServ */
+5 -1
View File
@@ -8,11 +8,15 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="2"
VERSION_BUILD="79"
VERSION_BUILD="80"
VERSION_EXTRA=""
# $Log$
#
# BUILD : 1.7.2 (80)
# BUGS : N/A
# NOTES : Added Memos/ChannelInfo to the moduleAddData() system
#
# BUILD : 1.7.2 (79)
# BUGS :
# NOTES : Added check to anoperc to see if paths work, and fixed one grammar error