]> arthur.barton.de Git - ngircd-alex.git/blob - contrib/Anope/0014-ngircd-set-unset-GLINE-s-on-AKILL-commands.patch
doc/Services.txt: Update documentation for Anope 1.9.8
[ngircd-alex.git] / contrib / Anope / 0014-ngircd-set-unset-GLINE-s-on-AKILL-commands.patch
1 From acc24a7f4488f6ef0fb240a76766db4220b62d53 Mon Sep 17 00:00:00 2001
2 From: Alexander Barton <alex@barton.de>
3 Date: Sun, 22 Jan 2012 19:05:28 +0100
4 Subject: [PATCH 14/16] ngircd: set/unset GLINE's on AKILL commands
5
6 ---
7  modules/protocol/ngircd.cpp |   10 ++++++++--
8  1 files changed, 8 insertions(+), 2 deletions(-)
9
10 diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
11 index 024c61d..3bc3812 100644
12 --- a/modules/protocol/ngircd.cpp
13 +++ b/modules/protocol/ngircd.cpp
14 @@ -48,10 +48,16 @@ class ngIRCdProto : public IRCDProto
15  {
16         void SendAkill(User *u, const XLine *x)
17         {
18 -               // TODO: ADD SOME CODE
19 +               // Calculate the time left before this would expire, capping it at 2 days
20 +               time_t timeleft = x->Expires - Anope::CurTime;
21 +               if (timeleft > 172800 || !x->Expires)
22 +                       timeleft = 172800;
23 +               UplinkSocket::Message(Config->ServerName) << "GLINE " << x->Mask << " " << timeleft << " :" << x->Reason << " (" << x->By << ")";
24         }
25  
26 -       void SendAkillDel(const XLine*) { }
27 +       void SendAkillDel(const XLine *x) {
28 +               UplinkSocket::Message(Config->ServerName) << "GLINE " << x->Mask;
29 +       }
30  
31         void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
32         {
33 -- 
34 1.7.8.3
35