X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/0d16e639f672a804cea43bd4b98684838b0d932d..db4e7826812cf256f6382cafcf93c3986040d842:/src/hash.c diff --git a/src/hash.c b/src/hash.c index 8a3c7ed..6e1005f 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1,7 +1,7 @@ /* hash.c - IRC network state database * Copyright 2000-2004 srvx Development Team * - * This file is part of srvx. + * This file is part of x3. * * srvx is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -692,7 +692,7 @@ reg_topic_func(topic_func_t handler) } void -SetChannelTopic(struct chanNode *channel, struct userNode *user, const char *topic, int announce) +SetChannelTopic(struct chanNode *channel, struct userNode *service, struct userNode *user, const char *topic, int announce) { unsigned int n; struct modeNode *mn; @@ -713,7 +713,7 @@ SetChannelTopic(struct chanNode *channel, struct userNode *user, const char *top if (announce) { /* We don't really care if a local user messes with the topic, * so don't call the tf_list functions. */ - irc_topic(user, channel, topic); + irc_topic(service, user, channel, topic); } else { for (n=0; nmembers.list); + verify(user); + verify(user->channels.list); + if (channel->members.used < user->channels.used) { + for (n=0; nmembers.used; n++) { + verify(channel->members.list[n]); + if (user == channel->members.list[n]->user) { + return(user); + } + } + } else { + for (n=0; nchannels.used; n++) { + verify(user->channels.list[n]); + if (channel == user->channels.list[n]->channel) { + return(user); + } + } + } + return NULL; +} + DEFINE_LIST(userList, struct userNode*) DEFINE_LIST(modeList, struct modeNode*) DEFINE_LIST(banList, struct banNode*)