]> jfr.im git - irc/SurrealServices/srsv.git/commitdiff
Fix bot not opping itself on join in insp... Unreal is still borken in most parts
authorerry <redacted>
Fri, 15 Jul 2011 12:20:12 +0000 (12:20 +0000)
committererry <redacted>
Fri, 15 Jul 2011 12:20:12 +0000 (12:20 +0000)
Some of my code is horrible.. And i'm using $ircd_capabilities to determine if we're using insp for some things. I know i should do this another way

git-svn-id: http://svn.tabris.net/repos/srsv@3540 70d4eda1-72e9-0310-a436-91e5bd24443c

branches/0.5.0/SrSv/Insp/Parse.pm
branches/0.5.0/SrSv/Insp/Send.pm
branches/0.5.0/SrSv/Unreal/Parse.pm
branches/0.5.0/modules/serviceslibs/botserv.pm
branches/0.5.0/modules/serviceslibs/chanserv.pm

index 7d5a1be92ee0de971ac31a38a87681f6d5d18f3d..21dfb9b68bfc2518e2cabbe9329b8c64ccf5ba0e 100644 (file)
@@ -747,7 +747,7 @@ sub CAPAB {
 #What we care about:  CHANMODES :admin=&a founder=~q Determines if we can set +a and +q on people, halfop %h: likewise... cloak=x determines if we can have cloaks or vhosts. in the modules we care about chghost, chgident, cloaking for vhosts, m_silence and m_watch for silence and watch respectively. Also c_registered, we can _NOT_ continue w/o it.
 #I HAVE NO IDEA where to get the watch/silence list limit!!!
 #let's do this the lame way!
-#FIXME this is so ugly
+       #FIXME this is so ugly
        my $capab = $_[0];
        print "CAPAB $_[0]\n";
        $capab =~ /CAPAB (\S+)/;
@@ -785,6 +785,7 @@ sub CAPAB {
        if ($capab =~ /registered/) {
                $IRCd_capabilities{"REG"} = 1;
        }
+       $IRCd_capabilities {"INSP"} = 1; #this is _horrible_
        
 }
 sub STATS($) {
index 74ee52f1a35e8937170b2428de8593197f420fda..9909e4b57e8e206f38f5a826a841b1b021cbca10 100644 (file)
@@ -374,9 +374,6 @@ sub ban_list($$$$@) {
 sub setmode($$$;$) {
        my ($src, $dst, $modes, $target) = @_;
        my $srcId;
-       print "IRCD::SETMODE\n";
-       print Dumper ($src);
-       print Dumper ($target);
        if (initial_synced()) {
                if (ref($src) eq "HASH") {
                        $srcId = ($src->{ID}?$src->{ID}:($src->{UUID}?$src->{UUID}:$src->{NICK}));
@@ -391,13 +388,13 @@ sub setmode($$$;$) {
        }
        my $targetId;
        if (ref ($target) eq "HASH") {
-               $targetId = ($target->{UID}?$target->{UID}:($target->{ID}?$target->{ID}:$target->{NICK}));
+               $targetId = ($target->{UID}?$target->{UID}:($target->{ID}?encodeUUID($target->{ID}):$target->{NICK}));
        }
        else {
                $targetId = $target;
        }
        callfuncs('MODE', undef, 1, [$srcId, $dst, $modes, $targetId]);
-       print "$ircline -- setmode($srcId, $dst, $modes, $targetId)\n" ;
+       print "$ircline -- setmode($srcId, $dst, $modes, $targetId)\n" if DEBUG;
        ircsend(":$srcId MODE $dst $modes $targetId");
 }
 
index 67472122e934b421a4e7d2545fcaa064bb275cf8..771bac227bd3909062d47d7d165509ac3b224f39 100644 (file)
@@ -673,7 +673,7 @@ sub ISUPPORT($) {
                my ($key, $value) = split('=', $token);
                $IRCd_capabilities{$key} = ($value ? $value : 1);
        }
-       #for insp... unreal supports it anyway  
+       # Insp compatibility... :(
        $IRCd_capabilities{"CHGHOST"} = 1;
        $IRCd_capabilities{"CHGIDENT"} = 1;
        $IRCd_capabilities{"CLOAKHOST"} = 1;
@@ -683,6 +683,8 @@ sub ISUPPORT($) {
        $IRCd_capabilities{"SILENCE"} = 32; 
        $IRCd_capabilities{"WATCH"} = 32;
        $IRCd_capabilities{"REG"} = 1;
+       $IRCd_capabilities{"INSP"} = 0;
+       # so ugly. Ugly Ugly UGLY.
 }
 
 sub STATS($) {
index c636e937a7f8be0e17da7e1a8023bd59b460fda6..c2ad550638d6cb36315918e48e2846e6217fa96a 100644 (file)
@@ -882,9 +882,7 @@ sub bot_join($;$) {
        unless(is_agent_in_chan($nick, $cn)) {
                agent_join($bot, $cn);
                my $bot2 = { NICK => $nick, ID => ircd::getUuid($nick), UID=>ircd::getUuid($nick) };
-               print Dumper ($botchmode);
-               print Dumper ($bot);
-               ircd::setmode($bot, $cn, $botchmode, $bot );
+               ircd::setmode($bot2, $cn, $botchmode, $bot2 );
        }
 }
 
index 5b89f3ee427953a4fd5d30760bc0b74b6ea9dcc0..47f113f421393a58a0afb04348b24c96de5500b5 100644 (file)
@@ -4808,8 +4808,13 @@ sub chan_mode($$$$) {
                if($mode eq '-') { $sign = 0; next; }
                
                my $arg = shift(@args) if($mode =~ $scm or $mode =~ $ocm);
-               my $auser = { ID => $arg };
-               
+               my $auser;
+               if ($IRCd_capabilities {"INSP"} == 1) { #FIXME this is awful
+                       $auser = { ID => $arg };
+               }
+               else {
+                       $auser = { NICK => $arg };
+               }       
                if($mode =~ /^[vhoaq]$/) {
                        next if $arg eq '';
                        next if is_agent($arg);