-// $Id: ChangeLog,v 1.158 2008/04/16 20:29:35 danielaustin Exp $ //
+// $Id: ChangeLog,v 1.159 2008/04/16 20:34:38 danielaustin Exp $ //
+
+2008-04-16 Dan-m00 <daniel@undernet.org>
+ * mod.cservice/cservice.cc:
+ * mod.cservice/JOINCommand.cc:
+ * mod.cservice/OPERJOINCommand.cc:
+ * mod.cservice/OPERPARTCommand.cc:
+ * mod.cservice/PARTCommand.cc:
+ * mod.cservice/PURGECommand.cc:
+ * mod.cservice/REGISTERCommand.cc:
+ * mod.cservice/SETCommand.cc: Add support to cservice module for
+ new '+R' mode. Also adjust channel events to watch for
+ registered channels even when the bot is not present.
2008-04-16 Dan-m00 <daniel@undernet.org>
* include/Channel.h:
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: JOINCommand.cc,v 1.14 2003/06/28 01:21:20 dan_karrels Exp $
+ * $Id: JOINCommand.cc,v 1.15 2008/04/16 20:34:39 danielaustin Exp $
*/
#include "responses.h"
#include "Network.h"
-const char JOINCommand_cc_rcsId[] = "$Id: JOINCommand.cc,v 1.14 2003/06/28 01:21:20 dan_karrels Exp $" ;
+const char JOINCommand_cc_rcsId[] = "$Id: JOINCommand.cc,v 1.15 2008/04/16 20:34:39 danielaustin Exp $" ;
namespace gnuworld
{
bot->writeChannelLog(theChan, theClient, sqlChannel::EV_JOIN, "");
theChan->setInChan(true);
-bot->getUplink()->RegisterChannelEvent( theChan->getName(), bot);
+/* force setting mode +R - it is probably set already, but doesn't hurt to check */
bot->Join(theChan->getName(),
- "",
+ "+R",
theChan->getChannelTS(),
false);
bot->joinCount++;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: OPERJOINCommand.cc,v 1.15 2005/01/08 23:33:42 dan_karrels Exp $
+ * $Id: OPERJOINCommand.cc,v 1.16 2008/04/16 20:34:39 danielaustin Exp $
*/
#include <string>
#include "Network.h"
#include "cservice_config.h"
-const char OPERJOINCommand_cc_rcsId[] = "$Id: OPERJOINCommand.cc,v 1.15 2005/01/08 23:33:42 dan_karrels Exp $" ;
+const char OPERJOINCommand_cc_rcsId[] = "$Id: OPERJOINCommand.cc,v 1.16 2008/04/16 20:34:39 danielaustin Exp $" ;
namespace gnuworld
{
bot->writeChannelLog(theChan, theClient, sqlChannel::EV_OPERJOIN, "");
theChan->setInChan(true);
-bot->getUplink()->RegisterChannelEvent( theChan->getName(), bot);
bot->Join(theChan->getName(),
theChan->getChannelMode(),
theChan->getChannelTS(),
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: OPERPARTCommand.cc,v 1.14 2005/01/08 23:33:42 dan_karrels Exp $
+ * $Id: OPERPARTCommand.cc,v 1.15 2008/04/16 20:34:39 danielaustin Exp $
*/
#include <string>
#include "Network.h"
#include "cservice_config.h"
-const char OPERPARTCommand_cc_rcsId[] = "$Id: OPERPARTCommand.cc,v 1.14 2005/01/08 23:33:42 dan_karrels Exp $" ;
+const char OPERPARTCommand_cc_rcsId[] = "$Id: OPERPARTCommand.cc,v 1.15 2008/04/16 20:34:39 danielaustin Exp $" ;
namespace gnuworld
{
theChan->getName().c_str());
theChan->setInChan(false);
-bot->getUplink()->UnRegisterChannelEvent(theChan->getName(), bot);
bot->joinCount--;
bot->Part(theChan->getName(), "At the request of an IRC Operator");
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: PARTCommand.cc,v 1.16 2003/06/28 01:21:20 dan_karrels Exp $
+ * $Id: PARTCommand.cc,v 1.17 2008/04/16 20:34:40 danielaustin Exp $
*/
#include "responses.h"
#include "Network.h"
-const char PARTCommand_cc_rcsId[] = "$Id: PARTCommand.cc,v 1.16 2003/06/28 01:21:20 dan_karrels Exp $" ;
+const char PARTCommand_cc_rcsId[] = "$Id: PARTCommand.cc,v 1.17 2008/04/16 20:34:40 danielaustin Exp $" ;
namespace gnuworld
{
}
theChan->setInChan(false);
-bot->getUplink()->UnRegisterChannelEvent(theChan->getName(), bot);
bot->joinCount--;
/* Forced access. */
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: PURGECommand.cc,v 1.21 2008/01/09 23:05:53 kewlio Exp $
+ * $Id: PURGECommand.cc,v 1.22 2008/04/16 20:34:40 danielaustin Exp $
*/
#include <string>
#include "responses.h"
#include "cservice_config.h"
-const char PURGECommand_cc_rcsId[] = "$Id: PURGECommand.cc,v 1.21 2008/01/09 23:05:53 kewlio Exp $" ;
+const char PURGECommand_cc_rcsId[] = "$Id: PURGECommand.cc,v 1.22 2008/04/16 20:34:40 danielaustin Exp $" ;
namespace gnuworld
{
/* Remove from cache.. part channel. */
bot->sqlChannelCache.erase(theChan->getName());
bot->sqlChannelIDCache.erase(theChan->getID());
+/* no longer interested in this channel */
bot->getUplink()->UnRegisterChannelEvent( theChan->getName(), bot ) ;
+/* remove mode 'R' (no longer registered) */
+Channel* tmpChan = Network->findChannel(theChan->getName());
+if (tmpChan)
+ bot->getUplink()->Mode(NULL, tmpChan, string("-R"), string() );
bot->Part(theChan->getName());
bot->joinCount--;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: REGISTERCommand.cc,v 1.22 2007/11/06 13:32:08 kewlio Exp $
+ * $Id: REGISTERCommand.cc,v 1.23 2008/04/16 20:34:43 danielaustin Exp $
*/
#include <map>
#include "Network.h"
#include "responses.h"
-const char REGISTERCommand_cc_rcsId[] = "$Id: REGISTERCommand.cc,v 1.22 2007/11/06 13:32:08 kewlio Exp $" ;
+const char REGISTERCommand_cc_rcsId[] = "$Id: REGISTERCommand.cc,v 1.23 2008/04/16 20:34:43 danielaustin Exp $" ;
namespace gnuworld
{
pair<int, int> thePair( newManager->getUserId(), newManager->getChannelId());
bot->sqlLevelCache.insert(cservice::sqlLevelHashType::value_type(thePair, newManager));
+ /* set channel mode R - tmpChan is created further above */
+ if (tmpChan)
+ bot->getUplink()->Mode(NULL, tmpChan, string("+R"), string() );
+
return true;
}
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: SETCommand.cc,v 1.63 2007/12/31 14:16:43 kewlio Exp $
+ * $Id: SETCommand.cc,v 1.64 2008/04/16 20:34:44 danielaustin Exp $
*/
#include <string>
#include "responses.h"
#include "cservice_config.h"
-const char SETCommand_cc_rcsId[] = "$Id: SETCommand.cc,v 1.63 2007/12/31 14:16:43 kewlio Exp $" ;
+const char SETCommand_cc_rcsId[] = "$Id: SETCommand.cc,v 1.64 2008/04/16 20:34:44 danielaustin Exp $" ;
namespace gnuworld
{
{
theChan->setFlag(sqlChannel::F_AUTOJOIN);
theChan->setInChan(true);
- bot->getUplink()->RegisterChannelEvent( theChan->getName(), bot ) ;
bot->Join(theChan->getName(), theChan->getChannelMode(),
theChan->getChannelTS(), false);
bot->joinCount++;
theChan->removeFlag(sqlChannel::F_AUTOJOIN);
theChan->setInChan(false);
bot->joinCount--;
- bot->getUplink()->UnRegisterChannelEvent( theChan->getName(), bot ) ;
bot->Part(theChan->getName());
}
else
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: cservice.cc,v 1.284 2008/01/02 17:32:49 kewlio Exp $
+ * $Id: cservice.cc,v 1.285 2008/04/16 20:34:44 danielaustin Exp $
*/
#include <new>
* is on.
*/
+ Channel* tmpChan;
sqlChannelHashType::iterator ptr = sqlChannelCache.begin();
while (ptr != sqlChannelCache.end())
{
sqlChannel* theChan = (ptr)->second;
+ /* we're now interested in registered channels even if we're not in it... */
+ MyUplink->RegisterChannelEvent( theChan->getName(), this ) ;
+
if ( (theChan->getFlag(sqlChannel::F_AUTOJOIN)) && (theChan->getName() != "*") )
{
+ string tempModes = theChan->getChannelMode();
+ tempModes += 'R';
MyUplink->JoinChannel( this,
theChan->getName(),
- theChan->getChannelMode(),
+ tempModes,
theChan->getChannelTS(),
true );
- MyUplink->RegisterChannelEvent( theChan->getName(), this ) ;
-
theChan->setInChan(true);
joinCount++;
if (getConfigVar("BAN_CHECK_ON_BURST")->asInt() == 1)
{
/* check current inhabitants of the channel against our banlist */
- Channel* tmpChan = Network->findChannel(theChan->getName());
+ tmpChan = Network->findChannel(theChan->getName());
for (Channel::userIterator chanUsers = tmpChan->userList_begin();
chanUsers != tmpChan->userList_end(); ++chanUsers)
{
(void)checkBansOnJoin(tmpChan, theChan, tmpUser->getClient());
}
}
+ } else {
+ if (theChan->getName() != "*")
+ {
+ /* although AUTOJOIN isn't set, set the channel to +R if
+ * it exists on the Network.
+ */
+ tmpChan = Network->findChannel(theChan->getName());
+ if (tmpChan)
+ {
+ string tempModes = "+R";
+ MyUplink->Mode(NULL, tmpChan, tempModes, string() );
+ }
+ }
}
++ptr;
}
*/
theChan->setInChan(false);
- MyUplink->UnRegisterChannelEvent(theChan->getName(), this);
theChan->removeFlag(sqlChannel::F_AUTOJOIN);
theChan->commit();
joinCount--;
return ;
}
+ /* This is a registered channel, check it is set +R.
+ * If not, set it to +R (channel creation)
+ */
+ if (!theChan->getMode(Channel::MODE_REG))
+ MyUplink->Mode(NULL, theChan, string("+R"), string() );
+
/*
* First thing we do - check if this person is banned.
* If so, they're booted out.