Update to version 2.9.3a
[tropbot.git] / objects.cc
1 //-----------------------------------------------------------------------------
2
3 #include "objects.h"
4 #include "tblib.h"
5
6 extern int current_time;
7
8 //-----------------------------------------------------------------------------
9
10 WaitPing::WaitPing(char *n, char *v, int t)
11 {
12   nick = strdup(n);
13   value = strdup(v);
14   time_max = t;
15 };
16
17 WaitPing::~WaitPing()
18 {
19   delete[] nick;
20   delete[] value;
21 };
22
23 WaitInfos::WaitInfos(char *n, char *c, DCCChat *ch, char *u, int m, int d)
24 {
25   nick = strdup(n);
26   comment = strdup(c);
27   chat = ch;
28   user = strdup(u);
29   mode = m;
30   duration = d;
31 };
32
33 WaitInfos::~WaitInfos()
34 {
35   delete[] nick;
36   delete[] comment;
37   delete[] user;
38 };
39
40 Welcome::Welcome(char *p, char *c, int time)
41 {
42   pattern = strdup(p);
43   comment = strdup(c);
44   time_max = time;
45 };
46
47 Welcome::~Welcome()
48 {
49   delete[] pattern;
50   delete[] comment;
51 };
52
53 //-----------------------------------------------------------------------------
54
55 DelayModeChange::DelayModeChange(char *w, char *m, char *p, int delay)
56 {
57   where = strdup(w);
58   mode = strdup(m);
59   parameter = strdup(p);
60   time = delay+current_time;
61 };
62
63 DelayModeChange::~DelayModeChange()
64 {
65   delete[] where;
66   delete[] mode;
67   delete[] parameter;
68 };
69
70 //-----------------------------------------------------------------------------
71
72 Person::Person(char *p, int l, char *pwd)
73 {
74   pattern = strdup(p);
75   level = l;
76   passwd = strdup(pwd);
77 };
78
79 Person::~Person()
80 {
81   delete[] pattern;
82 };
83
84 //-----------------------------------------------------------------------------
85
86 DCCChat::DCCChat(char *p, int s, int l)
87 {
88   prefix = strdup(p);
89   socket = s;
90   level = l;
91 };
92
93 DCCChat::~DCCChat()
94 {
95   delete[] prefix;
96 };
97
98 //-----------------------------------------------------------------------------