add_memo(time_t sent, struct memo_account *recipient, struct memo_account *sender, char *message, int nfrom_read)
{
struct memo *memo;
- struct history *history;
memo = calloc(1, sizeof(*memo));
if (!memo)
memoCount++;
if (nfrom_read)
- history = add_history(sent, recipient, sender, memo->id);
+ add_history(sent, recipient, sender, memo->id);
return memo;
}
{
char *str;
struct handle_info *sender, *recipient;
- struct history *history;
unsigned long id;
time_t sent;
return 0;
}
- history = add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
+ add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
return 0;
}
}
static void
-memoserv_cleanup(void)
+memoserv_cleanup(UNUSED_ARG(void *extra))
{
dict_delete(memos);
dict_delete(historys);
}
static void
-memoserv_check_messages(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
+memoserv_check_messages(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle), UNUSED_ARG(void *extra))
{
unsigned int ii, unseen;
struct memo_account *ma;
}
static void
-memoserv_unreg_account(UNUSED_ARG(struct userNode *user), struct handle_info *handle)
+memoserv_unreg_account(UNUSED_ARG(struct userNode *user), struct handle_info *handle, UNUSED_ARG(void *extra))
{
dict_remove(memos, handle->handle);
dict_remove(historys, handle->handle);
memos = dict_new();
historys = dict_new();
dict_set_free_data(memos, delete_memo_account);
- reg_auth_func(memoserv_check_messages);
+ reg_auth_func(memoserv_check_messages, NULL);
reg_handle_rename_func(memoserv_rename_account, NULL);
- reg_unreg_func(memoserv_unreg_account);
+ reg_unreg_func(memoserv_unreg_account, NULL);
conf_register_reload(memoserv_conf_read);
- reg_exit_func(memoserv_cleanup);
+ reg_exit_func(memoserv_cleanup, NULL);
saxdb_register("MemoServ", memoserv_saxdb_read, memoserv_saxdb_write);
memoserv_module = module_register("MemoServ", MS_LOG, "mod-memoserv.help", NULL);
memoserv = memoserv_conf.bot;
const char *modes = conf_get_data("modules/memoserv/modes", RECDB_QSTRING);
memoserv = AddLocalUser(str, str, NULL, "User-User Memorandum Services", modes);
+ service_register(memoserv);
} else {
log_module(MS_LOG, LOG_ERROR, "database_get_data for memoserv_conf.bot failed!");
exit(1);