~ubuntu-branches/ubuntu/quantal/znc/quantal-backports

« back to all changes in this revision

Viewing changes to modules/clientnotify.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2013-01-01 19:39:47 UTC
  • mfrom: (21.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130101193947-zlqyse3v2mjxnhvw
Tags: 1.0-2~ubuntu12.10.1
No-change backport to quantal (LP: #1085731)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2004-2011  See the AUTHORS file for details.
 
2
 * Copyright (C) 2004-2012  See the AUTHORS file for details.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of the GNU General Public License version 2 as published
6
6
 * by the Free Software Foundation.
7
7
 */
8
8
 
9
 
#include "znc.h"
10
 
#include "User.h"
 
9
#include <znc/znc.h>
 
10
#include <znc/User.h>
 
11
 
 
12
using std::set;
11
13
 
12
14
class CClientNotifyMod : public CModule {
13
15
protected:
55
57
                if(!m_bNewOnly || m_sClientsSeen.find(m_pClient->GetRemoteIP()) == m_sClientsSeen.end()) {
56
58
                        SendNotification("Another client authenticated as your user. "
57
59
                                "Use the 'ListClients' command to see all " +
58
 
                                CString(m_pUser->GetClients().size())  + " clients.");
 
60
                                CString(m_pUser->GetAllClients().size())  + " clients.");
59
61
 
60
62
                        // the set<> will automatically disregard duplicates:
61
63
                        m_sClientsSeen.insert(m_pClient->GetRemoteIP());
66
68
                if(m_bOnDisconnect) {
67
69
                        SendNotification("A client disconnected from your user. "
68
70
                                "Use the 'ListClients' command to see the " +
69
 
                                CString(m_pUser->GetClients().size()) + " remaining client(s).");
 
71
                                CString(m_pUser->GetAllClients().size()) + " remaining client(s).");
70
72
                }
71
73
        }
72
74
 
106
108
        Info.SetWikiPage("clientnotify");
107
109
}
108
110
 
109
 
MODULEDEFS(CClientNotifyMod, "Notifies you when another IRC client logs into or out of your account. Configurable.")
 
111
USERMODULEDEFS(CClientNotifyMod, "Notifies you when another IRC client logs into or out of your account. Configurable.")
110
112