File: nickserv.pl.diff

package info (click to toggle)
irssi-scripts 20070925
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,708 kB
  • ctags: 2,415
  • sloc: perl: 54,737; makefile: 43; sh: 20
file content (68 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- nickserv.pl	Wed Sep 17 23:14:44 2003
+++ scripts/nickserv.pl	Wed Jul 28 13:05:00 2004
@@ -59,7 +59,7 @@
 delnick:    Delete a nickname from the NickServ list.
 listnet:    Display the contents of the NickServ network list.
 listnick:   Display the contents of the NickServ nickname list.
-help:       Display this usefull little helpfile.
+help:       Display this useful little helptext.
 
 Examples: (all on one line)
 /NICKSERV addnet Freenode NickServ\@services.
@@ -123,9 +123,6 @@
         }
         
         close(F);
-    } else {
-        create_network_file($file);
-        save_nickservnet($file);
     }
 }
 
@@ -133,6 +130,8 @@
 
     my ($file) = @_;
 
+    return unless scalar @nickservnet; # there's nothing to save
+
     if (-e $file) {
         local *F;
         open(F, ">$file");
@@ -186,9 +185,6 @@
         }
         
         close(F);
-    } else {
-        create_nick_file($file);
-        save_nickservnick($file);
     }
 }
 
@@ -196,6 +192,8 @@
 
     my ($file) = @_;
 
+    return unless scalar @nickservauth; # there's nothing to save
+
     if (-e $file) {
         local *F;
         open(F, ">$file");
@@ -215,7 +213,9 @@
     
     my ($file) = @_;
     
+    my $umask = umask 0077; # save old umask
     open(F, ">$file") or die "Can't create $file. Reason: $!";
+    umask $umask;
 }
 
 sub new_nickserv_nick {
@@ -378,7 +378,7 @@
         Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'nickname_info');
 
         for (my $n = 0; $n < @nickservauth ; ++$n) {
-            Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'nickname_print', $n, $nickservauth[$n]->{ircnet}, $nickservauth[$n]->{nick}, $nickservauth[$n]->{pass});
+            Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'nickname_print', $n, $nickservauth[$n]->{ircnet}, $nickservauth[$n]->{nick}, "*" x length($nickservauth[$n]->{pass}));
         }
     }
 }