~ubuntu-branches/ubuntu/utopic/telephony-service/utopic-proposed

« back to all changes in this revision

Viewing changes to libtelephonyservice/chatmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Tiago Salem Herrmann
  • Date: 2014-07-17 18:24:00 UTC
  • mfrom: (1.1.44)
  • Revision ID: package-import@ubuntu.com-20140717182400-vfn8vw7bvzlbikb9
Tags: 0.1+14.10.20140717.1-0ubuntu1
[ Tiago Salem Herrmann ]
Add isAccountConnected() so apps can track status of individual
accounts. Fix crash when sending acks during the app startup .

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    mMessagesAckTimer.setInterval(1000);
54
54
    mMessagesAckTimer.setSingleShot(true);
55
55
    connect(&mMessagesAckTimer, SIGNAL(timeout()), SLOT(onAckTimerTriggered()));
 
56
    connect(TelepathyHelper::instance(), SIGNAL(connectedChanged()), SLOT(onConnectedChanged()));
 
57
}
 
58
 
 
59
void ChatManager::onConnectedChanged()
 
60
{
 
61
    if (TelepathyHelper::instance()->connected()) {
 
62
        onAckTimerTriggered();
 
63
    }
56
64
}
57
65
 
58
66
ChatManager *ChatManager::instance()
202
210
        account = TelepathyHelper::instance()->accountForId(accountId);
203
211
    }
204
212
 
 
213
    if (account.isNull()) {
 
214
        mMessagesToAck[accountId][phoneNumber].append(messageId);
 
215
        return;
 
216
    }
 
217
 
205
218
    mMessagesAckTimer.start();
206
219
    mMessagesToAck[account->uniqueIdentifier()][phoneNumber].append(messageId);
207
220
}