View Issue Details

IDProjectCategoryView StatusLast Update
0001587Anope Stable (2.0.x series)Generalpublic2014-04-24 06:26
ReporterxClone84 Assigned ToAdam  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Summary0001587: Changing a BotServ bot causes it to not come back
DescriptionChanging a BotServ bot via "/msg BotServ BOT CHANGE" will cause the bot to leave the channel, say it is in that channel but not come back on reload. Only a restart.
Steps To ReproduceAdd a BotServ bot, change a setting on it. It will then quit with the message "Quit: Be right back" and not come back unless services restart.
TagsNo tags attached.

Activities

Adam

2014-04-24 06:26

administrator   ~0006619

Thanks, fixed in d52cc7bcbcf9b99a58eedc823418a91f85e8cab9

CMF2000

2014-04-23 16:14

reporter  

bs_bot.patch (703 bytes)   
--- modules/commands/bs_bot.cpp	2014-03-23 13:59:14.000000000 +0100
+++ modules/commands/bs_bot.cpp	2014-04-23 14:21:26.000000000 +0200
@@ -212,8 +212,25 @@
 			{
 				const ChannelInfo *ci = *it;
 
-				if (ci->c && ci->c->users.size() >= minusers)
-					bi->Join(ci->c);
+				if (!ci->c)
+					continue;
+
+				ChanUserContainer *cuc = ci->c->FindUser(bi);
+				if (cuc)
+				{
+					Anope::string botmodes = cuc->status.Modes();
+					ci->c->DeleteUser(bi);
+					if (ci->c->users.size() >= minusers)
+					{
+						ChannelStatus status(botmodes);
+						bi->Join(ci->c, &status);
+					}
+				}
+				else
+				{
+					if (ci->c->users.size() >= minusers)
+						bi->Join(ci->c);
+				}
 			}
 		}
 
bs_bot.patch (703 bytes)   

CMF2000

2014-04-23 16:13

reporter   ~0006618

Last edited: 2014-04-23 16:54

View 2 revisions

I can confirm this bug. The bot stays internally on the channel and thats the reason why he doesn't join the channel again.
I've made a patch for this issue.

Maybe it's not necessary to use Channel::DeleteUser() and better to join the bot with IRCDProto::SendJoin() instead of BotInfo::Join(). But I think to delete the bot from the channel is more safer.

Issue History

Date Modified Username Field Change
2014-04-22 00:12 xClone84 New Issue
2014-04-23 16:13 CMF2000 Note Added: 0006618
2014-04-23 16:14 CMF2000 File Added: bs_bot.patch
2014-04-23 16:54 CMF2000 Note Edited: 0006618 View Revisions
2014-04-24 06:26 Adam Note Added: 0006619
2014-04-24 06:26 Adam Status new => resolved
2014-04-24 06:26 Adam Resolution open => fixed
2014-04-24 06:26 Adam Assigned To => Adam