giveownership = calloc(1, sizeof(*giveownership));
giveownership->issued = now;
- giveownership->old_owner = curr_user->handle->handle;
- giveownership->target = new_owner_hi->handle;
+ giveownership->old_owner = strdup(curr_user->handle->handle);
+ giveownership->target = strdup(new_owner_hi->handle);
giveownership->target_access = new_owner_old_access;
if(override)
{
int
trace_check_bans(struct userNode *user, struct chanNode *chan)
{
- struct chanData *cData;
struct banData *bData;
struct mod_chanmode *change;
- if(!(cData = chan->channel_info))
- return 0;
-
change = find_matching_bans(&chan->banlist, user, NULL);
if (change)
return 1;
- /* ircd list
- if (chan->banlist.used) {
- unsigned int i;
- for (i=0; i<chan->banlist.used; i++) {
- if (!user_matches_glob(user, chan->banlist.list[i], MATCH_USENICK))
- return 1;
- }
- }
-*/
/* lamer list */
- if(chan->banlist.used < MAXBANS)
- {
- for(bData = cData->bans;
- bData && !user_matches_glob(user, bData->mask, MATCH_USENICK);
- bData = bData->next);
+ if (chan->channel_info) {
+ for(bData = chan->channel_info->bans; bData; bData = bData->next) {
- if(bData) {
- return 1;
+ if(!user_matches_glob(user, bData->mask, MATCH_USENICK))
+ continue;
+
+ if(bData)
+ return 1;
}
}
return 0;
}
+int
+channel_user_is_exempt(struct userNode *user, struct chanNode *channel)
+{
+ unsigned int ii;
+ for(ii = 0; ii < channel->exemptlist.used; ii++)
+ {
+ if(user_matches_glob(user, channel->exemptlist.list[ii]->exempt, MATCH_USENICK))
+ return true;
+ }
+ return false;
+}
+
/* Welcome to my worst nightmare. Warning: Read (or modify)
the code below at your own risk. */
unsigned int modes = 0, info = 0;
char *greeting;
- if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info))
+ if(IsLocal(user) || !channel || !channel->channel_info || IsSuspended(channel->channel_info))
return 0;
cData = channel->channel_info;
/* TODO: maybe only people above inviteme level? -Rubin */
/* We don't kick people with access */
- if(!uData)
+ if(!uData && !channel_user_is_exempt(user, channel))
{
if(channel->banlist.used < MAXBANS)
{