2
2
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
4
* Copyright (c) 1997-2014 ircd-hybrid development team
4
* Copyright (c) 1997-2015 ircd-hybrid development team
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
53
52
m_away(struct Client *source_p, int parc, char *parv[])
55
if (!IsFloodDone(source_p))
56
flood_endgrace(source_p);
54
const char *const message = parv[1];
58
if (parc < 2 || EmptyString(parv[1]))
56
if (EmptyString(message))
60
58
/* Marking as not away */
61
59
if (source_p->away[0])
63
61
source_p->away[0] = '\0';
65
63
/* We now send this only if they were away before --is */
66
sendto_server(source_p, NOCAPS, NOCAPS, ":%s AWAY", source_p->id);
64
sendto_server(source_p, 0, 0, ":%s AWAY", source_p->id);
67
65
sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, ":%s!%s@%s AWAY",
68
66
source_p->name, source_p->username,
76
if ((source_p->localClient->away.last_attempt + ConfigGeneral.away_time) < CurrentTime)
77
source_p->localClient->away.count = 0;
74
if ((source_p->connection->away.last_attempt + ConfigGeneral.away_time) < CurrentTime)
75
source_p->connection->away.count = 0;
79
if (source_p->localClient->away.count > ConfigGeneral.away_count)
77
if (source_p->connection->away.count > ConfigGeneral.away_count)
81
79
sendto_one_numeric(source_p, &me, ERR_TOOMANYAWAY);
85
source_p->localClient->away.last_attempt = CurrentTime;
86
source_p->localClient->away.count++;
83
source_p->connection->away.last_attempt = CurrentTime;
84
source_p->connection->away.count++;
88
strlcpy(source_p->away, parv[1], sizeof(source_p->away));
86
strlcpy(source_p->away, message, sizeof(source_p->away));
90
88
sendto_one_numeric(source_p, &me, RPL_NOWAWAY);
91
89
sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, ":%s!%s@%s AWAY :%s",
92
90
source_p->name, source_p->username,
93
91
source_p->host, source_p->away);
94
sendto_server(source_p, NOCAPS, NOCAPS, ":%s AWAY :%s",
92
sendto_server(source_p, 0, 0, ":%s AWAY :%s",
95
93
source_p->id, source_p->away);
111
109
ms_away(struct Client *source_p, int parc, char *parv[])
113
if (parc < 2 || EmptyString(parv[1]))
111
const char *const message = parv[1];
113
if (EmptyString(message))
115
115
/* Marking as not away */
116
116
if (source_p->away[0])
118
118
source_p->away[0] = '\0';
120
120
/* We now send this only if they were away before --is */
121
sendto_server(source_p, NOCAPS, NOCAPS, ":%s AWAY", source_p->id);
121
sendto_server(source_p, 0, 0, ":%s AWAY", source_p->id);
122
122
sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, ":%s!%s@%s AWAY",
123
123
source_p->name, source_p->username,
130
strlcpy(source_p->away, parv[1], sizeof(source_p->away));
130
strlcpy(source_p->away, message, sizeof(source_p->away));
132
132
sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, ":%s!%s@%s AWAY :%s",
133
133
source_p->name, source_p->username,
134
134
source_p->host, source_p->away);
135
sendto_server(source_p, NOCAPS, NOCAPS, ":%s AWAY :%s",
135
sendto_server(source_p, 0, 0, ":%s AWAY :%s",
136
136
source_p->id, source_p->away);
162
162
.node = { NULL, NULL, NULL },
164
.version = "$Revision: 4564 $",
164
.version = "$Revision: 5346 $",
166
166
.modinit = module_init,
167
167
.modexit = module_exit,