~jdong/+junk/znc

« back to all changes in this revision

Viewing changes to Timers.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2008-12-06 23:28:22 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081206232822-6n1lkcot8o78bk9f
Tags: 0.062-2
* Add missing ${misc:Depends}. Thanks lintian.
* Fix debian/watch, so that it does not take the new znc-extra tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include "IRCSock.h"
14
14
#include "User.h"
15
15
 
16
 
class CKeepNickTimer : public CCron {
17
 
public:
18
 
        CKeepNickTimer(CUser* pUser) : CCron() {
19
 
                m_pUser = pUser;
20
 
                m_uTrys = 0;
21
 
                SetName("CKeepNickTimer::" + m_pUser->GetUserName());
22
 
                Start(5);
23
 
        }
24
 
        virtual ~CKeepNickTimer() {}
25
 
 
26
 
private:
27
 
protected:
28
 
        virtual void RunJob() {
29
 
                CIRCSock* pSock = m_pUser->GetIRCSock();
30
 
 
31
 
                if (pSock) {
32
 
                        if (m_uTrys++ >= 40) {
33
 
                                pSock->SetOrigNickPending(false);
34
 
                                m_uTrys = 0;
35
 
                        }
36
 
 
37
 
                        pSock->KeepNick();
38
 
                }
39
 
        }
40
 
 
41
 
        CUser*                  m_pUser;
42
 
        unsigned int    m_uTrys;
43
 
};
44
 
 
45
16
class CMiscTimer : public CCron {
46
17
public:
47
18
        CMiscTimer(CUser* pUser) : CCron() {