]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
cap_sasl 1.9: support different cmdchars
authorMantas Mikulėnas <redacted>
Thu, 18 Dec 2014 20:59:16 +0000 (22:59 +0200)
committerMantas Mikulėnas <redacted>
Thu, 18 Dec 2014 20:59:16 +0000 (22:59 +0200)
_data/scripts.yaml
scripts/cap_sasl.pl

index 5944567cc5edef16220716fe54e70ef6bb176cfe..e8732fe0a44829fe31d4911b896cff1154807d18 100644 (file)
   contact: "grawity@gmail.com"
   description: "Implements SASL authentication (and multi-prefix as free bonus)"
   filename: "cap_sasl.pl"
-  modified: "2014-12-18 05:37:00"
+  modified: "2014-12-18 22:58:00"
   modules: "Crypt::PK::ECC MIME::Base64"
   license: "GPLv2"
   name: "cap_sasl"
   url: "https://nullroute.eu.org/~grawity/irssi.html"
-  version: "1.8"
+  version: "1.9"
 
 - authors: "ZaMz0n"
   commands: "cddb"
index ad6df45349e14449762451fe200cb369d59b1335..a9dc23734a7f081f480f453e509a8c1d0167b67b 100644 (file)
@@ -4,7 +4,7 @@ use MIME::Base64;
 use vars qw($VERSION %IRSSI);
 use constant CHALLENGE_SIZE => 32;
 
-$VERSION = "1.8a";
+$VERSION = "1.9";
 %IRSSI = (
     authors     => 'Michael Tharp (gxti), Jilles Tjoelker (jilles), Mantas Mikulėnas (grawity)',
     contact     => 'grawity@gmail.com',
@@ -340,7 +340,9 @@ if (eval {require Crypt::PK::ECC}) {
 
                my $priv = $pk->export_key_pem("private");
                my $pub = encode_base64($pk->export_key_raw("public_compressed"), "");
-               my $cmd = "/msg NickServ SET PROPERTY pubkey $pub";
+
+               my $cmdchar = substr(Irssi::settings_get_str("cmdchars"), 0, 1);
+               my $cmd = "msg NickServ SET PROPERTY pubkey $pub";
 
                if (open(my $fh, ">", $f_priv)) {
                        chmod(0600, $f_priv);
@@ -370,10 +372,10 @@ if (eval {require Crypt::PK::ECC}) {
                        $server->command($cmd);
                } else {
                        $print->("SASL: update your Irssi settings:");
-                       $print->("%P/sasl set $net <nick> $f_name.key $mech");
+                       $print->("%P".$cmdchar."sasl set $net <nick> $f_name.key $mech");
 
                        $print->("SASL: submit your public key to $net:");
-                       $print->("%P$cmd");
+                       $print->("%P".$cmdchar.$cmd);
                }
        }
 
git clone https://git.99rst.org/PROJECT