- if(adding)
- {
- /* It's a properly valid redirecting ban, and we're adding it */
- if(!channel->GetExt("banredirects", redirects))
- {
- redirects = new BanRedirectList;
- channel->Extend("banredirects", redirects);
- }
-
- /* Here 'param' doesn't have the channel on it yet */
- redirects->push_back(BanRedirectEntry(mask[CHAN].c_str(), param.c_str()));
-
- /* Now it does */
- param.append(mask[CHAN]);
- }
- else
+ redirects = new BanRedirectList;
+ extItem.set(channel, redirects);
+ }
+
+ /* Here 'param' doesn't have the channel on it yet */
+ redirects->push_back(BanRedirectEntry(mask[CHAN], param));
+
+ /* Now it does */
+ param.append(mask[CHAN]);
+ }
+ else
+ {
+ /* Removing a ban, if there's no extensible there are no redirecting bans and we're fine. */
+ redirects = extItem.get(channel);
+ if (redirects)
+ {
+ /* But there were, so we need to remove the matching one if there is one */
+
+ for(BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); redir++)