Commit 1be57bd5 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

newcallmodel: add voicemail notification related signals

Change-Id: I86c0be35cc56b03b39279d239fe77bb83fe5240c
parent bc5b6841
...@@ -251,6 +251,15 @@ Q_SIGNALS: ...@@ -251,6 +251,15 @@ Q_SIGNALS:
*/ */
void callAddedToConference(const std::string& callId, const std::string& confId) const; void callAddedToConference(const std::string& callId, const std::string& confId) const;
/**
* Emitted when a voice mail notice arrives
* @param accountId
* @param newCount
* @param oldCount
* @param urgentCount
*/
void voiceMailNotify(const std::string& accountId, int newCount, int oldCount, int urgentCount) const;
private: private:
std::unique_ptr<NewCallModelPimpl> pimpl_; std::unique_ptr<NewCallModelPimpl> pimpl_;
}; };
......
...@@ -145,6 +145,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent) ...@@ -145,6 +145,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent)
&CallbacksHandler::slotIncomingMessage, &CallbacksHandler::slotIncomingMessage,
Qt::QueuedConnection); Qt::QueuedConnection);
connect(&CallManager::instance(),
&CallManagerInterface::voiceMailNotify,
this,
&CallbacksHandler::slotVoiceMailNotify,
Qt::QueuedConnection);
connect(&ConfigurationManager::instance(), connect(&ConfigurationManager::instance(),
&ConfigurationManagerInterface::dataTransferEvent, &ConfigurationManagerInterface::dataTransferEvent,
this, this,
...@@ -264,6 +270,12 @@ CallbacksHandler::slotNearbyPeerSubscription(const QString& accountId, ...@@ -264,6 +270,12 @@ CallbacksHandler::slotNearbyPeerSubscription(const QString& accountId,
emit newPeerSubscription(accountId.toStdString(), contactUri.toStdString(), state, displayname.toStdString()); emit newPeerSubscription(accountId.toStdString(), contactUri.toStdString(), state, displayname.toStdString());
} }
void
CallbacksHandler::slotVoiceMailNotify(const QString& accountId, int newCount, int oldCount, int urgentCount)
{
emit voiceMailNotify(accountId.toStdString(), newCount, oldCount, urgentCount);
}
void void
CallbacksHandler::slotContactAdded(const QString& accountId, CallbacksHandler::slotContactAdded(const QString& accountId,
const QString& contactUri, const QString& contactUri,
......
...@@ -268,6 +268,15 @@ Q_SIGNALS: ...@@ -268,6 +268,15 @@ Q_SIGNALS:
*/ */
void audioMeter(const std::string& id, float level); void audioMeter(const std::string& id, float level);
/**
* Emitted when an audio level is received
* @param accountId
* @param newCount
* @param oldCount
* @param urgentCount
*/
void voiceMailNotify(const std::string& accountId, int newCount, int oldCount, int urgentCount);
private Q_SLOTS: private Q_SLOTS:
/** /**
* Emit newAccountMessage * Emit newAccountMessage
...@@ -488,6 +497,18 @@ private Q_SLOTS: ...@@ -488,6 +497,18 @@ private Q_SLOTS:
int state, int state,
const QString& displayname); const QString& displayname);
/**
* Emit voiceMailNotify
* @param accountId
* @param new VM
* @param old VM
* @param new Urgent VM
*/
void slotVoiceMailNotify(const QString& accountId,
int newCount,
int oldCount,
int urgentCount);
private: private:
const api::Lrc& parent; const api::Lrc& parent;
}; };
......
...@@ -166,6 +166,14 @@ public Q_SLOTS: ...@@ -166,6 +166,14 @@ public Q_SLOTS:
* @param callId * @param callId
*/ */
void slotConferenceCreated(const std::string& callId); void slotConferenceCreated(const std::string& callId);
/**
* Listen from CallbacksHandler when a voice mail notice is incoming
* @param accountId
* @param newCount
* @param oldCount
* @param urgentCount
*/
void slotVoiceMailNotify(const std::string& accountId, int newCount, int oldCount, int urgentCount);
}; };
NewCallModel::NewCallModel(const account::Info& owner, const CallbacksHandler& callbacksHandler) NewCallModel::NewCallModel(const account::Info& owner, const CallbacksHandler& callbacksHandler)
...@@ -423,6 +431,7 @@ NewCallModelPimpl::NewCallModelPimpl(const NewCallModel& linked, const Callbacks ...@@ -423,6 +431,7 @@ NewCallModelPimpl::NewCallModelPimpl(const NewCallModel& linked, const Callbacks
connect(&callbacksHandler, &CallbacksHandler::callStateChanged, this, &NewCallModelPimpl::slotCallStateChanged); connect(&callbacksHandler, &CallbacksHandler::callStateChanged, this, &NewCallModelPimpl::slotCallStateChanged);
connect(&callbacksHandler, &CallbacksHandler::incomingVCardChunk, this, &NewCallModelPimpl::slotincomingVCardChunk); connect(&callbacksHandler, &CallbacksHandler::incomingVCardChunk, this, &NewCallModelPimpl::slotincomingVCardChunk);
connect(&callbacksHandler, &CallbacksHandler::conferenceCreated, this , &NewCallModelPimpl::slotConferenceCreated); connect(&callbacksHandler, &CallbacksHandler::conferenceCreated, this , &NewCallModelPimpl::slotConferenceCreated);
connect(&callbacksHandler, &CallbacksHandler::voiceMailNotify, this, &NewCallModelPimpl::slotVoiceMailNotify);
#ifndef ENABLE_LIBWRAP #ifndef ENABLE_LIBWRAP
// Only necessary with dbus since the daemon runs separately // Only necessary with dbus since the daemon runs separately
...@@ -630,6 +639,12 @@ NewCallModelPimpl::slotincomingVCardChunk(const std::string& callId, ...@@ -630,6 +639,12 @@ NewCallModelPimpl::slotincomingVCardChunk(const std::string& callId,
} }
} }
void
NewCallModelPimpl::slotVoiceMailNotify(const std::string & accountId, int newCount, int oldCount, int urgentCount)
{
emit linked.voiceMailNotify(accountId, newCount, oldCount, urgentCount);
}
bool bool
NewCallModel::hasCall(const std::string& callId) const NewCallModel::hasCall(const std::string& callId) const
{ {
......
...@@ -69,9 +69,9 @@ public: ...@@ -69,9 +69,9 @@ public:
Q_EMIT recordPlaybackStopped(QString(filepath.c_str())); Q_EMIT recordPlaybackStopped(QString(filepath.c_str()));
}), }),
exportable_callback<CallSignal::VoiceMailNotify>( exportable_callback<CallSignal::VoiceMailNotify>(
[this] (const std::string &accountID, int count) { [this] (const std::string &accountId, int newCount, int oldCount, int urgentCount) {
LOG_DRING_SIGNAL2("voiceMailNotify",QString(accountID.c_str()), count); LOG_DRING_SIGNAL4("voiceMailNotify",QString(accountId.c_str()), newCount, oldCount, urgentCount);
Q_EMIT voiceMailNotify(QString(accountID.c_str()), count); Q_EMIT voiceMailNotify(QString(accountId.c_str()), newCount, oldCount, urgentCount);
}), }),
exportable_callback<CallSignal::IncomingMessage>( exportable_callback<CallSignal::IncomingMessage>(
[this] (const std::string &callID, const std::string &from, const std::map<std::string,std::string> &message) { [this] (const std::string &callID, const std::string &from, const std::map<std::string,std::string> &message) {
...@@ -373,7 +373,7 @@ Q_SIGNALS: // SIGNALS ...@@ -373,7 +373,7 @@ Q_SIGNALS: // SIGNALS
void transferFailed(); void transferFailed();
void transferSucceeded(); void transferSucceeded();
void recordPlaybackStopped(const QString &filepath); void recordPlaybackStopped(const QString &filepath);
void voiceMailNotify(const QString &accountID, int count); void voiceMailNotify(const QString &accountId, int newCount, int oldCount, int urgentCount);
void incomingMessage(const QString &callID, const QString &from, const MapStringString &message); void incomingMessage(const QString &callID, const QString &from, const MapStringString &message);
void incomingCall(const QString &accountID, const QString &callID, const QString &from); void incomingCall(const QString &accountID, const QString &callID, const QString &from);
void recordPlaybackFilepath(const QString &callID, const QString &filepath); void recordPlaybackFilepath(const QString &callID, const QString &filepath);
......
...@@ -302,7 +302,7 @@ Q_SIGNALS: // SIGNALS ...@@ -302,7 +302,7 @@ Q_SIGNALS: // SIGNALS
void transferFailed(); void transferFailed();
void transferSucceeded(); void transferSucceeded();
void recordPlaybackStopped(const QString &filepath); void recordPlaybackStopped(const QString &filepath);
void voiceMailNotify(const QString &accountID, int count); void voiceMailNotify(const QString &accountId, int newCount, int oldCount, int urgentCount);
void incomingMessage(const QString &callID, const QString &from, const MapStringString &message); void incomingMessage(const QString &callID, const QString &from, const MapStringString &message);
void incomingCall(const QString &accountID, const QString &callID, const QString &from); void incomingCall(const QString &accountID, const QString &callID, const QString &from);
void recordPlaybackFilepath(const QString &callID, const QString &filepath); void recordPlaybackFilepath(const QString &callID, const QString &filepath);
......
Supports Markdown
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