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
1=== modified file 'classbot.pl'
2--- classbot.pl 2010-02-20 22:10:26 +0000
3+++ classbot.pl 2010-02-21 04:30:28 +0000
4@@ -268,15 +268,17 @@
5 Irssi::print("$nick is already voiced in $chan. Doing Nothing.") if($debug);
6 }
7 elsif($bool && $nick->{voice}==0) {
8- Irssi::print("Voicing $name in $chan.") if($debug);
9+ Irssi::print("Voicing $name in $chan &qchan.") if($debug);
10 $server->command("^MSG ChanServ VOICE $chan $name");
11+ $server->command("^MSG ChanServ VOICE $qchan $name");
12 }
13 elsif(!$bool && $nick->{voice}==0) {
14 Irssi::print("$nick is already devoiced in $chan. Doing Nothing.") if($debug);
15 }
16 elsif(!$bool && $nick->{voice}==1) {
17- Irssi::print("DeVoicing $name in $chan.") if($debug);
18+ Irssi::print("DeVoicing $name in $chan and $qchan.") if($debug);
19 $server->command("^MSG ChanServ DEVOICE $chan $name");
20+ $server->command("^MSG ChanServ DEVOICE $qchan $name");
21 }
22 }
23
24@@ -372,7 +374,8 @@
25 $person=$nick;
26 }
27 &voice($chan, $person, 1);
28- $server->command("^MSG $nick $person has been voiced in $chan.");
29+ &voice($qchan, $person, 1);
30+ $server->command("^MSG $nick $person has been voiced in $chan and $qchan.");
31 }
32 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(voice|v)\s*(.*?)$/i) {
33 Irssi::print("$nick is not an admin, so they cannot use !voice.") if($debug);
34@@ -384,7 +387,8 @@
35 $person=$nick;
36 }
37 &voice($chan, $person, 0);
38- $server->command("^MSG $nick $person has been devoiced in $chan.");
39+ &voice($qchan, $person, 0);
40+ $server->command("^MSG $nick $person has been devoiced in $chan and $qchan.");
41 }
42 elsif($target =~ m/^$mynick$/i && $text =~ m/^!(devoice|dv)\s*(.*?)$/i) {
43 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: