]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_redirect.cpp
Fix for bug #791, if an error is set treat this as 'could not get certificate'
[user/henk/code/inspircd.git] / src / modules / m_redirect.cpp
index 63ad7ee7e90e2253c76a9ae547c83bfa506693dd..9aa0dcf8b5f1432a96c6db6c9b8ce62570055b5d 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -50,14 +50,14 @@ class Redirect : public ModeHandler
                        }
 
                        c = ServerInstance->FindChan(parameter);
-                       if (!c)
+                       if (!c && !IS_OPER(source))
                        {
                                source->WriteNumeric(690, "%s :Target channel %s must exist to be set as a redirect.",source->nick.c_str(),parameter.c_str());
                                parameter.clear();
                                return MODEACTION_DENY;
                        }
 
-                       if (c->GetStatus(source) < STATUS_OP && !IS_OPER(source))
+                       if (c && c->GetStatus(source) < STATUS_OP && !IS_OPER(source))
                        {
                                source->WriteNumeric(690, "%s :You must be opped on %s to set it as a redirect.",source->nick.c_str(),parameter.c_str());
                                parameter.clear();
@@ -120,11 +120,11 @@ class ModuleRedirect : public Module
                                        destchan = ServerInstance->FindChan(channel);
                                        if (destchan && destchan->IsModeSet('L'))
                                        {
-                                               user->WriteNumeric(470, "%s :You may not join %s. A redirect is set, but you may not be redirected as it is a circular loop.", user->nick.c_str(), cname);
+                                               user->WriteNumeric(470, "%s %s * :You may not join this channel. A redirect is set, but you may not be redirected as it is a circular loop.", user->nick.c_str(), cname);
                                                return 1;
                                        }
 
-                                       user->WriteNumeric(470, "%s :You may not join %s, so you are automatically being transferred to the redirect channel %s", user->nick.c_str(), cname, channel.c_str());
+                                       user->WriteNumeric(470, "%s %s %s :You may not join this channel, so you are automatically being transferred to the redirect channel.", user->nick.c_str(), cname, channel.c_str());
                                        Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", false, ServerInstance->Time());
                                        return 1;
                                }