Skip to content

Commit

Permalink
Make COtrTimer a friend of COtrMod
Browse files Browse the repository at this point in the history
Related to #11.
  • Loading branch information
mmilata committed Feb 16, 2014
1 parent cbd6dde commit 27d31b6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions otr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class COtrGenKeyTimer : public CTimer {
};

class COtrMod : public CModule {
friend class COtrTimer;
friend class COtrGenKeyTimer;

private:
Expand Down Expand Up @@ -454,10 +455,6 @@ friend class COtrGenKeyTimer;
m_Buffer.clear();
}

void TimerFires() {
otrl_message_poll(m_pUserState, &m_xOtrOps, this);
}

private:
// genkey thread routine
static void* GenKeyThreadFunc(void *data) {
Expand Down Expand Up @@ -738,10 +735,11 @@ NETWORKMODULEDEFS(COtrMod, "Off-the-Record (OTR) encryption for private messages

void COtrTimer::RunJob()
{
static_cast<COtrMod*>(m_pModule)->TimerFires();
COtrMod *mod = static_cast<COtrMod*>(m_pModule);
assert(mod);
otrl_message_poll(mod->m_pUserState, &mod->m_xOtrOps, mod);
}

// TODO: both timers as friends or both just call COtrMod method
void COtrGenKeyTimer::RunJob()
{
COtrMod *mod = static_cast<COtrMod*>(m_pModule);
Expand Down

0 comments on commit 27d31b6

Please sign in to comment.