- ServerInstance->Log(DEBUG,"No such user in ChanFounder");
- parameter = "";
- return MODEACTION_DENY;
- }
-
- // given user isnt even on the channel, eat the mode change
- if (!channel->HasUser(theuser))
- {
- ServerInstance->Log(DEBUG,"Channel doesn't have user in ChanFounder");
- parameter = "";
- return MODEACTION_DENY;
- }
-
- std::string protect = "cm_protect_"+std::string(channel->name);
- std::string founder = "cm_founder_"+std::string(channel->name);
-
- // source is a server, or ulined, we'll let them +-q the user.
- if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (!IS_LOCAL(source)))
- {
- ServerInstance->Log(DEBUG,"Allowing remote mode change in ChanFounder");
- if (adding)
- {
- if (!theuser->GetExt(founder,dummyptr))
- {
- ServerInstance->Log(DEBUG,"Does not have the ext item in ChanFounder");
- if (!theuser->Extend(founder,fakevalue))
- ServerInstance->Log(DEBUG,"COULD NOT EXTEND!!!");
- // Tidy the nickname (make case match etc)
- parameter = theuser->nick;
- if (theuser->GetExt(founder, dummyptr))
- ServerInstance->Log(DEBUG,"Extended!");
- else
- ServerInstance->Log(DEBUG,"Not extended :(");
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (theuser->GetExt(founder, dummyptr))
- {
- theuser->Shrink(founder);
- // Tidy the nickname (make case match etc)
- parameter = theuser->nick;
- return MODEACTION_ALLOW;
- }
- }
- return MODEACTION_DENY;
- }
- else
- {
- // whoops, someones being naughty!
- source->WriteServ("468 %s %s :Only servers may set channel mode +q",source->nick, channel->name);
- parameter = "";
- return MODEACTION_DENY;