This repository was archived by the owner on Mar 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsender.h
More file actions
97 lines (76 loc) · 2.11 KB
/
sender.h
File metadata and controls
97 lines (76 loc) · 2.11 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* sender.h
* Command compilation and sending routines
* Copyright (c) 2002 Alien Internet Services
*/
#ifndef __SENDER_H_
# define __SENDER_H_
# include <slist>
# include "config.h"
# include "daemon.h"
# include "str.h"
class Sender {
private:
typedef slist <String> textbuff_t;
static textbuff_t motdData;
static textbuff_t helpData;
Sender(void) {};
~Sender(void) {};
public:
static void init(void);
static void sendBurst(void);
static void sendCTCPpingReply(String const &who, String &data)
{
Daemon::queueAdd(String(":" MY_USERNICK " NO ") + who +
" :\001PING " + data + "\001");
};
# ifdef CTCP_SEX_REPLY
static void sendCTCPsexReply(String const &who)
{
Daemon::queueAdd(String(":" MY_USERNICK " NO ") + who +
" :\001SEX " CTCP_SEX_REPLY "\001");
};
# endif
static void sendCTCPversion(String const &who)
{
Daemon::queueAdd(String(":" MY_USERNICK " P ") + who +
" :\001VERSION\001");
};
static void sendCTCPversionReply(String const &who)
{
Daemon::queueAdd(String(":" MY_USERNICK " P ") + who +
" :\001VERSION " VERSION "\001");
};
static void sendMOTDreply(String const &);
static void sendNOTICE(String const &who, String &data)
{
Daemon::queueAdd(String(":" MY_USERNICK " NO ") + who + " :" + data);
};
static void sendPING()
{
Daemon::queueAdd(":" MY_SERVERNAME " PING :Hello?");
};
static void sendPONG(String &data)
{
Daemon::queueAdd(String(":" MY_SERVERNAME " PONG ") + data);
};
static void sendSQUIT(String const &reason)
{
Daemon::queueAdd(String(":" MY_SERVERNAME " SQUIT " MY_SERVERNAME
"0 :") + reason);
};
static void sendVERSIONreply(String const &who)
{
Daemon::queueAdd(String(":" MY_SERVERNAME " 351 ") + who +
" :" VERSION);
};
static void sendWHOISreply(String const &);
static void sendHelpReply(String const &);
static void sendStatsReply(String const &);
# ifdef ALLOW_RAW_COMMAND
static void Sender::sendRaw(String const &data)
{
Daemon::queueAdd(data);
};
# endif
};
#endif