del_all_accepts(target_p);
}
}
+
+bool
+has_common_channel(struct Client *source_p, struct Client *target_p)
+{
+ rb_dlink_node *ps, *pt;
+ struct membership *ms, *mt;
+ struct Channel *chptr;
+
+ ITER_COMM_CHANNELS(ps, pt, source_p->user->channel.head, target_p->user->channel.head, ms, mt, chptr)
+ {
+ if (ms != NULL && mt != NULL)
+ return true;
+ }
+
+ return false;
+}
+
{
target_p = ptr->data;
- rb_dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
- rb_dlinkDestroy(ptr, &source_p->on_allow_list);
+ if (!has_common_channel(source_p, target_p))
+ {
+ rb_dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
+ rb_dlinkDestroy(ptr, &source_p->on_allow_list);
+ }
}
snprintf(note, sizeof(note), "Nick: %s", nick);
change_remote_nick(struct Client *client_p, struct Client *source_p,
time_t newts, const char *nick, int dosend)
{
+ struct Client *target_p;
+ rb_dlink_node *ptr, *next_ptr;
struct nd_entry *nd;
int samenick = irccmp(source_p->name, nick) ? 0 : 1;
hook_cdata hook_info;
monitor_signon(source_p);
/* remove all accepts pointing to the client */
- del_all_accepts(source_p);
+ RB_DLINK_FOREACH_SAFE(ptr, next_ptr, source_p->on_allow_list.head)
+ {
+ target_p = ptr->data;
+
+ if (!has_common_channel(source_p, target_p))
+ {
+ rb_dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
+ rb_dlinkDestroy(ptr, &source_p->on_allow_list);
+ }
+ }
}
static void
static const char um_callerid_desc[] =
"Provides usermodes +g and +G which restrict messages from unauthorized users.";
-static bool
-has_common_channel(struct Client *source_p, struct Client *target_p)
-{
- rb_dlink_node *ps, *pt;
- struct membership *ms, *mt;
- struct Channel *chptr;
-
- ITER_COMM_CHANNELS(ps, pt, source_p->user->channel.head, target_p->user->channel.head, ms, mt, chptr)
- {
- if (ms != NULL && mt != NULL)
- return true;
- }
-
- return false;
-}
-
static bool
allow_message(struct Client *source_p, struct Client *target_p)
{