Merge lp:~cjohnston/ubuntu-classroom/voice-devoice into lp:~ubuntu-classroom/ubuntu-classroom/classbot

Proposed by Chris Johnston
Status: Merged
Merge reported by: Nathan Handler
Merged at revision: not available
Proposed branch: lp:~cjohnston/ubuntu-classroom/voice-devoice
Merge into: lp:~ubuntu-classroom/ubuntu-classroom/classbot
Diff against target: 43 lines (+8/-4)
1 file modified
classbot.pl (+8/-4)
To merge this branch: bzr merge lp:~cjohnston/ubuntu-classroom/voice-devoice
Reviewer Review Type Date Requested Status
Nathan Handler Needs Fixing
Review via email: mp+19798@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Johnston (cjohnston) wrote :

!voice|!devoice work for both -classroom and -chat

Revision history for this message
Nathan Handler (nhandler) wrote :

Instead of modifying the voice sub to voice in $chan and $qchan, make 2 calls to &voice, passing $chan first and $qchan second.

review: Needs Fixing
Revision history for this message
Nathan Handler (nhandler) wrote :

I went ahead and made the change I suggested in order to get this feature implemented in time for tomorrow's test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'classbot.pl'
--- classbot.pl 2010-02-20 22:10:26 +0000
+++ classbot.pl 2010-02-21 04:30:28 +0000
@@ -268,15 +268,17 @@
268 Irssi::print("$nick is already voiced in $chan. Doing Nothing.") if($debug);268 Irssi::print("$nick is already voiced in $chan. Doing Nothing.") if($debug);
269 }269 }
270 elsif($bool && $nick->{voice}==0) {270 elsif($bool && $nick->{voice}==0) {
271 Irssi::print("Voicing $name in $chan.") if($debug);271 Irssi::print("Voicing $name in $chan &qchan.") if($debug);
272 $server->command("^MSG ChanServ VOICE $chan $name");272 $server->command("^MSG ChanServ VOICE $chan $name");
273 $server->command("^MSG ChanServ VOICE $qchan $name");
273 }274 }
274 elsif(!$bool && $nick->{voice}==0) {275 elsif(!$bool && $nick->{voice}==0) {
275 Irssi::print("$nick is already devoiced in $chan. Doing Nothing.") if($debug);276 Irssi::print("$nick is already devoiced in $chan. Doing Nothing.") if($debug);
276 }277 }
277 elsif(!$bool && $nick->{voice}==1) {278 elsif(!$bool && $nick->{voice}==1) {
278 Irssi::print("DeVoicing $name in $chan.") if($debug);279 Irssi::print("DeVoicing $name in $chan and $qchan.") if($debug);
279 $server->command("^MSG ChanServ DEVOICE $chan $name");280 $server->command("^MSG ChanServ DEVOICE $chan $name");
281 $server->command("^MSG ChanServ DEVOICE $qchan $name");
280 }282 }
281}283}
282284
@@ -372,7 +374,8 @@
372 $person=$nick;374 $person=$nick;
373 }375 }
374 &voice($chan, $person, 1);376 &voice($chan, $person, 1);
375 $server->command("^MSG $nick $person has been voiced in $chan.");377 &voice($qchan, $person, 1);
378 $server->command("^MSG $nick $person has been voiced in $chan and $qchan.");
376 }379 }
377 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(voice|v)\s*(.*?)$/i) {380 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(voice|v)\s*(.*?)$/i) {
378 Irssi::print("$nick is not an admin, so they cannot use !voice.") if($debug);381 Irssi::print("$nick is not an admin, so they cannot use !voice.") if($debug);
@@ -384,7 +387,8 @@
384 $person=$nick;387 $person=$nick;
385 }388 }
386 &voice($chan, $person, 0);389 &voice($chan, $person, 0);
387 $server->command("^MSG $nick $person has been devoiced in $chan.");390 &voice($qchan, $person, 0);
391 $server->command("^MSG $nick $person has been devoiced in $chan and $qchan.");
388 }392 }
389 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(devoice|dv)\s*(.*?)$/i) {393 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(devoice|dv)\s*(.*?)$/i) {
390 Irssi::print("$nick is not an admin, so they cannot use !devoice.") if($debug);394 Irssi::print("$nick is not an admin, so they cannot use !devoice.") if($debug);

Subscribers

People subscribed via source and target branches

to all changes: