projects
/
srvx.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Report the number of memos, not recipients, in /msg MemoServ status.
[srvx.git]
/
src
/
mod-memoserv.c
diff --git
a/src/mod-memoserv.c
b/src/mod-memoserv.c
index d580b6650e986d59087771aaa44131896aa8bfdd..447744fe07d391a0dd7ba6c71a91a46030ffaca8 100644
(file)
--- a/
src/mod-memoserv.c
+++ b/
src/mod-memoserv.c
@@
-118,7
+118,9
@@
static struct {
const char *memoserv_module_deps[] = { NULL };
static struct module *memoserv_module;
static struct log_type *MS_LOG;
const char *memoserv_module_deps[] = { NULL };
static struct module *memoserv_module;
static struct log_type *MS_LOG;
-static unsigned long memosSent, memosExpired;
+static unsigned long memoCount;
+static unsigned long memosSent;
+static unsigned long memosExpired;
static struct dict *memos; /* memo_account->handle->handle -> memo_account */
static struct memo_account *
static struct dict *memos; /* memo_account->handle->handle -> memo_account */
static struct memo_account *
@@
-146,6
+148,7
@@
delete_memo(struct memo *memo)
memoList_remove(&memo->sender->sent, memo);
free(memo->message);
free(memo);
memoList_remove(&memo->sender->sent, memo);
free(memo->message);
free(memo);
+ memoCount--;
}
static void
}
static void
@@
-205,6
+208,7
@@
add_memo(unsigned long sent, struct memo_account *recipient, struct memo_account
memo->sent = sent;
memo->message = strdup(message);
memosSent++;
memo->sent = sent;
memo->message = strdup(message);
memosSent++;
+ memoCount++;
return memo;
}
return memo;
}
@@
-436,7
+440,7
@@
static MODCMD_FUNC(cmd_set_private)
static MODCMD_FUNC(cmd_status)
{
static MODCMD_FUNC(cmd_status)
{
- reply("MSMSG_STATUS_TOTAL",
dict_size(memos)
);
+ reply("MSMSG_STATUS_TOTAL",
memoCount
);
reply("MSMSG_STATUS_EXPIRED", memosExpired);
reply("MSMSG_STATUS_SENT", memosSent);
return 1;
reply("MSMSG_STATUS_EXPIRED", memosExpired);
reply("MSMSG_STATUS_SENT", memosSent);
return 1;