Re: [PATCH]Halfop

Lucio Maciel <[email protected]> 26 May 2003 13:44:59 -0300
Newsgroups gmane.network.irc.irssi.devel
Message-ID <[email protected]>
sorry, now with the attachment... i'm allways foegetting it...

regards

On Mon, 2003-05-26 at 12:54, Adam Wiggles wrote:
> and umm what file does that go in?
> 
> ----- Original Message ----- 
> From: Lucio Maciel <[email protected]>
> To: <[email protected]>
> Sent: Monday, May 26, 2003 9:26 AM
> Subject: [PATCH]Halfop
> 
> 
> > Hi..
> > 
> > this little patch add a halfop entry in the channel rec structure. this
> > way is more easy to use an autovoice, autokick scripts halfoped in a
> > channel just checking 
> > 
> > return unless ($channel->{chanop} || $channel->{halfop});
> > 
> > 
> > regards.
> > -- 
> > 
> > "Se nao tivessemos defeitos, nao teriamos tanto prazer em nota-los
> > nos outros" (La Rochefoucauld)
> > 
> > ::: Lucio Maciel
> > ::: gcc @ gcc . com . br
> > ::: http://www.gcc.com.br
> > 
> > 
> > 
> 
-- 

"Se nao tivessemos defeitos, nao teriamos tanto prazer em nota-los
nos outros" (La Rochefoucauld)

::: Lucio Maciel
::: gcc @ gcc . com . br
::: http://www.gcc.com.br
halfop.diff (text/x-patch, 1.6 KB)
diff -ur ../irssi-0.8.6/src/core/channel-rec.h ./src/core/channel-rec.h
--- ../irssi-0.8.6/src/core/channel-rec.h	2002-05-15 21:34:31.000000000 -0300
+++ ./src/core/channel-rec.h	2003-05-26 10:06:05.000000000 -0300
@@ -16,6 +16,7 @@
 char *key; /* password key */
 
 unsigned int chanop:1; /* You're a channel operator */
+unsigned int halfop:1;
 unsigned int names_got:1; /* Received /NAMES list */
 unsigned int wholist:1; /* WHO list got */
 unsigned int synced:1; /* Channel synced - all queries done */
diff -ur ../irssi-0.8.6/src/irc/core/irc-nicklist.c ./src/irc/core/irc-nicklist.c
--- ../irssi-0.8.6/src/irc/core/irc-nicklist.c	2002-08-27 16:45:07.000000000 -0300
+++ ./src/irc/core/irc-nicklist.c	2003-05-26 10:07:03.000000000 -0300
@@ -162,7 +162,8 @@
 						      FALSE, FALSE);
 		}
 		nicklist_set_own(CHANNEL(chanrec), ownnick);
-                chanrec->chanop = chanrec->ownnick->op;
+		chanrec->chanop = chanrec->ownnick->op;
+		chanrec->halfop = chanrec->ownnick->halfop;
 		chanrec->names_got = TRUE;
 		signal_emit("channel joined", 1, chanrec);
 	}
diff -ur ../irssi-0.8.6/src/perl/perl-common.c ./src/perl/perl-common.c
--- ../irssi-0.8.6/src/perl/perl-common.c	2002-10-28 00:00:03.000000000 -0200
+++ ./src/perl/perl-common.c	2003-05-26 10:08:22.000000000 -0300
@@ -354,6 +354,7 @@
 	hv_store(hv, "key", 3, new_pv(channel->key), 0);
 
 	hv_store(hv, "chanop", 6, newSViv(channel->chanop), 0);
+	hv_store(hv, "halfop", 6, newSViv(channel->halfop), 0);
 	hv_store(hv, "names_got", 9, newSViv(channel->names_got), 0);
 	hv_store(hv, "wholist", 7, newSViv(channel->wholist), 0);
 	hv_store(hv, "synced", 6, newSViv(channel->synced), 0);