X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FHandleInfoHandler.c;h=c6a2efe808d2447330084c5396584613f64c2c9b;hp=6e5415ffe40381af7b894b72cc37f97d512a156a;hb=902ebfe5551be2daa3edf8141bcee91f62c0a5e0;hpb=8a990d2c87f8f8a6ca26dd2c6afef161dab2eb9e diff --git a/src/HandleInfoHandler.c b/src/HandleInfoHandler.c index 6e5415f..c6a2efe 100644 --- a/src/HandleInfoHandler.c +++ b/src/HandleInfoHandler.c @@ -21,6 +21,7 @@ #include "ChanNode.h" #include "IRCEvents.h" #include "tools.h" +#include "modules.h" #define AUTHSERV_NICK "AuthServ" @@ -29,6 +30,7 @@ struct HandleInfoQueueEntry { char *auth; void *callback[MAXCALLBACKS]; + int module_id[MAXCALLBACKS]; void *data[MAXCALLBACKS]; struct HandleInfoQueueEntry *next; @@ -79,7 +81,7 @@ void clear_handleinfoqueue(struct ClientSocket *client) { DESYNCHRONIZE(cache_sync); } -void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { +void lookup_authname(char *auth, int module_id, authlookup_callback_t callback, void *data) { struct ClientSocket *bot; struct HandleInfoQueueEntry* entry; for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { @@ -89,6 +91,7 @@ void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { for(i = 1; i < MAXCALLBACKS; i++) { if(!entry->callback[i]) { entry->callback[i] = callback; + entry->module_id[i] = module_id; entry->data[i] = data; return; } @@ -103,6 +106,7 @@ void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { int i; entry->auth = strdup(auth); entry->callback[0] = callback; + entry->module_id[0] = module_id; for(i = 1; i < MAXCALLBACKS; i++) entry->callback[i] = NULL; entry->data[0] = data; @@ -224,7 +228,8 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me for(i = 0; i < MAXCALLBACKS; i++) { callback = entry->callback[i]; if(!callback) break; - callback(entry->auth, exists, registered, entry->data[i]); + if(!entry->module_id[i] || module_loaded(entry->module_id[i])) + callback(entry->auth, exists, registered, entry->data[i]); } free(entry->auth); free(entry); @@ -233,7 +238,7 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me } void init_handleinfohandler() { - bind_privnotice(recv_notice); + bind_privnotice(recv_notice, 0); } void free_handleinfohandler() {