1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 18:13:12 +02:00

Fix bug #1041, patch by Adam (with coding style tweaks by me), CS LOGOUT should work as expected now.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2174 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2009-03-17 02:56:05 +00:00
parent 610dbf5c92
commit e78066213a
14 changed files with 62 additions and 28 deletions
+2
View File
@@ -1117,6 +1117,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Tots els usuaris identificats han estat desconnectats del canal %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1129,6 +1129,8 @@ CHAN_LOGOUT_SUCCEEDED
Der User %s wurde vom Channel %s ausgeloggt.
CHAN_LOGOUT_ALL_SUCCEEDED
Alle identifizierten User wurden vom Channel ausgeloggt %s (except the channel founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+3
View File
@@ -1094,6 +1094,9 @@ CHAN_LOGOUT_ALL_SUCCEEDED
All users identified have been logged out of channel %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1115,6 +1115,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Todos los usuarios identificados han sido desconectados del canal %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1128,6 +1128,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Tous les utilisateurs identifiés au canal %s ne le sont plus (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1115,6 +1115,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
¼ëïé ïé ÷ñÞóôåò logged out áðü ôï êáíÜëé %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1107,6 +1107,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Minden felhasználó kijelentkezett a %s csatornáról (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP válaszok
CHAN_DROP_SYNTAX
+2
View File
@@ -1105,6 +1105,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Tutti gli utenti non sono più identificati per il canale %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1119,6 +1119,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Alle geidentificeerde gebruikers zijn uitgelogd van kanaal %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1432,6 +1432,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Wylogowano zidentyfikowanych u¿ytkowników z kana³u %s (bez w³a¶ciciela).
CHAN_LOGOUT_FOUNDER_FAILED
Nie mo¿esz siê wylogowaæ z %s (jeste¶ w³a¶cicielem).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1114,6 +1114,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Todos os usuários registrados foram desconectados do canal %s (except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+2
View File
@@ -1084,6 +1084,8 @@ CHAN_IDENTIFY_SUCCEEDED
Ïàðîëü ïðèíÿò, òåïåðü âàø óðîâåíü äîñòóïà íà êàíàëå %s - âëàäåëåö.
CHAN_LOGOUT_FOUNDER_FAILED
Âû íå ìîæåòå äåèäåíòèôèöèðîâàòü ñåáÿ îòíîñòèòåëüíî êàíàëà %s ò.ê. âû åãî ðåàëüíûé âëàäåëåö.
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# LOGOUT responses
CHAN_LOGOUT_SYNTAX
+2
View File
@@ -1122,6 +1122,8 @@ CHAN_LOGOUT_ALL_SUCCEEDED
Tüm tanýmlý kullanýcýlar artýk %s kanalý tarafýndan tanýnmýyor (Except the channel founder).
CHAN_LOGOUT_FOUNDER_FAILED
You may not log out of %s (you are founder).
CHAN_LOGOUT_NOT_LOGGEDIN
%s was not logged into %s.
# DROP responses
CHAN_DROP_SYNTAX
+35 -28
View File
@@ -28,12 +28,12 @@ void myChanServHelp(User * u)
class CommandCSLogout : public Command
{
private:
void make_unidentified(User * u, ChannelInfo * ci)
int make_unidentified(User *u, ChannelInfo *ci)
{
struct u_chaninfolist *uci;
if (!u || !ci)
return;
return 0;
for (uci = u->founder_chans; uci; uci = uci->next)
{
@@ -46,13 +46,16 @@ class CommandCSLogout : public Command
else
u->founder_chans = uci->next;
delete uci;
break;
return 1;
}
}
return 0;
}
public:
CommandCSLogout() : Command("LOGOUT", 2, 2)
CommandCSLogout() : Command("LOGOUT", 1, 2)
{
}
@@ -63,41 +66,41 @@ class CommandCSLogout : public Command
const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
ChannelInfo *ci;
User *u2 = NULL;
int is_admin = u->nc->HasCommand("chanserv/logout");
if (!(ci = cs_findchan(chan)))
{
if (!is_admin && !nick)
this->OnSyntaxError(u);
else if (!(ci = cs_findchan(chan)))
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
}
else if ((ci->flags & CI_FORBIDDEN))
{
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
}
else if (nick && !(u2 = finduser(nick)))
{
notice_lang(s_ChanServ, u, NICK_X_NOT_IN_USE, nick);
}
else if (u2 != u && !is_real_founder(u, ci))
{
else if (u2 != u && !is_real_founder(u, ci) && !is_admin)
notice_lang(s_ChanServ, u, ACCESS_DENIED);
}
else if (u2 == u && is_real_founder(u, ci))
{
/* Since founders can not logout we should tell them -katsklaw */
notice_lang(s_ChanServ, u, CHAN_LOGOUT_FOUNDER_FAILED, chan);
}
else {
if (u2) {
make_unidentified(u2, ci);
notice_lang(s_ChanServ, u, CHAN_LOGOUT_SUCCEEDED, nick, chan);
alog("%s: User %s!%s@%s has been logged out of channel %s.",
s_ChanServ, u2->nick, u2->GetIdent().c_str(), u2->host, chan);
} else {
else
{
if (u2)
{
if (make_unidentified(u2, ci))
{
notice_lang(s_ChanServ, u, CHAN_LOGOUT_SUCCEEDED, nick, chan);
alog("%s: User %s!%s@%s has been logged out of channel %s.", s_ChanServ, u2->nick, u2->GetIdent().c_str(), u2->host, chan);
}
else
notice_lang(s_ChanServ, u, CHAN_LOGOUT_NOT_LOGGEDIN, nick, chan);
}
else
{
int i;
for (i = 0; i < 1024; i++)
for (u2 = userlist[i]; u2; u2 = u2->next)
make_unidentified(u2, ci);
notice_lang(s_ChanServ, u, CHAN_LOGOUT_ALL_SUCCEEDED, chan);
alog("%s: All users identified have been logged out of channel %s.", s_ChanServ, chan);
alog("%s: User %s!%s@%s logged all identified users out of channel %s.", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, chan);
}
}
@@ -106,13 +109,19 @@ class CommandCSLogout : public Command
bool OnHelp(User *u, const std::string &subcommand)
{
notice_help(s_NickServ, u, CHAN_HELP_LOGOUT);
if (u->nc->HasCommand("chanserv/logout"))
notice_help(s_NickServ, u, CHAN_SERVADMIN_HELP_LOGOUT);
else
notice_help(s_NickServ, u, CHAN_HELP_LOGOUT);
return true;
}
void OnSyntaxError(User *u)
{
syntax_error(s_NickServ, u, "LOGOUT", CHAN_LOGOUT_SYNTAX);
if (u->nc->HasCommand("chanserv/logout"))
syntax_error(s_NickServ, u, "LOGOUT", CHAN_LOGOUT_SERVADMIN_SYNTAX);
else
syntax_error(s_NickServ, u, "LOGOUT", CHAN_LOGOUT_SYNTAX);
}
};
@@ -130,6 +139,4 @@ class CSLogout : public Module
}
};
MODULE_INIT("cs_logout", CSLogout)