Commit dd09e6d3 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): coding style

parent 0310ccb6
......@@ -39,6 +39,8 @@ ContactModel::ContactModel (shared_ptr<linphone::Friend> linphone_friend) {
}
ContactModel::ContactModel (VcardModel *vcard) {
Q_ASSERT(vcard != nullptr);
QQmlEngine *engine = App::getInstance()->getEngine();
if (engine->objectOwnership(vcard) == QQmlEngine::CppOwnership)
throw invalid_argument("A contact is already linked to this vcard.");
......@@ -49,8 +51,11 @@ ContactModel::ContactModel (VcardModel *vcard) {
engine->setObjectOwnership(vcard, QQmlEngine::CppOwnership);
}
void ContactModel::presenceReceived () {
Presence::PresenceStatus status = static_cast<Presence::PresenceStatus>(m_linphone_friend->getConsolidatedPresence());
void ContactModel::refreshPresence () {
Presence::PresenceStatus status = static_cast<Presence::PresenceStatus>(
m_linphone_friend->getConsolidatedPresence()
);
emit presenceStatusChanged(status);
emit presenceLevelChanged(Presence::getPresenceLevel(status));
}
......
......@@ -48,7 +48,7 @@ public:
return m_vcard;
}
void presenceReceived ();
void refreshPresence ();
Q_INVOKABLE void startEdit ();
Q_INVOKABLE void endEdit ();
......
......@@ -69,12 +69,11 @@ void CoreHandlers::onMessageReceived (
void CoreHandlers::onNotifyPresenceReceivedForUriOrTel (
const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Friend> &lf,
const shared_ptr<linphone::Friend> &linphone_friend,
const string &,
const shared_ptr<linphone::PresenceModel> &
) {
ContactModel *contact_model = &lf->getData<ContactModel>("contact-model");
contact_model->presenceReceived();
linphone_friend->getData<ContactModel>("contact-model").refreshPresence();
}
void CoreHandlers::onRegistrationStateChanged (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment