Enhance threadsafety of Hooks and improve generally
[clinton/bobotpp.git] / source / Person.C
CommitLineData
cb21075d 1// Person.C -*- C++ -*-
2// Copyright (c) 1998 Etienne BERNARD
a6339323 3// Copyright (c) 2005 Clinton Ebadi
cb21075d 4
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// any later version.
9
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
7b564711 17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18// 02110-1301, USA.
cb21075d 19
2169cb10 20#include "Bot.H"
cb21075d 21#include "Utils.H"
22#include "Person.H"
23
24Person::Person(Bot *b, String a)
25 : bot(b), address(a)
26{ }
27
28Person::Person(Person &p)
29 : bot(p.bot), address(p.address)
30{ }
31
32Person *
33Person::copy()
34{
35 return new Person(*this);
36}
37
38String
39Person::getNick() const
40{
a6339323 41 return Utils::get_nick (address);
cb21075d 42}
43
44String
45Person::getAddress() const
46{
47 return address;
48}
49
50Person &
51Person::operator=(const String & a)
52{
53 address = a;
54 return *this;
55}
56
57void
58Person::sendNotice(String message)
59{
60 bot->serverConnection->queue->sendNotice(getNick(), message);
61}