1. Added set/name, set/qra, set/location, set/qth, set/homenode, set/bbs,
[spider.git] / cmd / set / name.pl
1 #
2 # set the name of the user
3 #
4 # Copyright (c) 1998 - Dirk Koopman
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my $call = $self->call;
11 my $user;
12
13 # remove leading and trailing spaces
14 $line =~ s/^\s+//;
15 $line =~ s/\s+$//;
16
17 return (1, $self->msg('namee1')) if !$line;
18
19 $user = DXUser->get_current($call);
20 if ($user) {
21         $user->name($line);
22         $user->put();
23         DXProt::broadcast_ak1a(DXProt::pc41($call, 1, $line), $DXProt::me);
24         return (1, $self->msg('name', $line));
25 } else {
26         return (1, $self->msg('namee2', $call));
27 }
28