Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-libclient
Commits
1be57bd5
Commit
1be57bd5
authored
Oct 01, 2019
by
Ming Rui Zhang
Browse files
newcallmodel: add voicemail notification related signals
Change-Id: I86c0be35cc56b03b39279d239fe77bb83fe5240c
parent
bc5b6841
Changes
6
Show whitespace changes
Inline
Side-by-side
src/api/newcallmodel.h
View file @
1be57bd5
...
...
@@ -251,6 +251,15 @@ Q_SIGNALS:
*/
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:
std
::
unique_ptr
<
NewCallModelPimpl
>
pimpl_
;
};
...
...
src/callbackshandler.cpp
View file @
1be57bd5
...
...
@@ -145,6 +145,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent)
&
CallbacksHandler
::
slotIncomingMessage
,
Qt
::
QueuedConnection
);
connect
(
&
CallManager
::
instance
(),
&
CallManagerInterface
::
voiceMailNotify
,
this
,
&
CallbacksHandler
::
slotVoiceMailNotify
,
Qt
::
QueuedConnection
);
connect
(
&
ConfigurationManager
::
instance
(),
&
ConfigurationManagerInterface
::
dataTransferEvent
,
this
,
...
...
@@ -264,6 +270,12 @@ CallbacksHandler::slotNearbyPeerSubscription(const QString& accountId,
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
CallbacksHandler
::
slotContactAdded
(
const
QString
&
accountId
,
const
QString
&
contactUri
,
...
...
src/callbackshandler.h
View file @
1be57bd5
...
...
@@ -268,6 +268,15 @@ Q_SIGNALS:
*/
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
:
/**
* Emit newAccountMessage
...
...
@@ -488,6 +497,18 @@ private Q_SLOTS:
int
state
,
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:
const
api
::
Lrc
&
parent
;
};
...
...
src/newcallmodel.cpp
View file @
1be57bd5
...
...
@@ -166,6 +166,14 @@ public Q_SLOTS:
* @param 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
)
...
...
@@ -423,6 +431,7 @@ NewCallModelPimpl::NewCallModelPimpl(const NewCallModel& linked, const Callbacks
connect
(
&
callbacksHandler
,
&
CallbacksHandler
::
callStateChanged
,
this
,
&
NewCallModelPimpl
::
slotCallStateChanged
);
connect
(
&
callbacksHandler
,
&
CallbacksHandler
::
incomingVCardChunk
,
this
,
&
NewCallModelPimpl
::
slotincomingVCardChunk
);
connect
(
&
callbacksHandler
,
&
CallbacksHandler
::
conferenceCreated
,
this
,
&
NewCallModelPimpl
::
slotConferenceCreated
);
connect
(
&
callbacksHandler
,
&
CallbacksHandler
::
voiceMailNotify
,
this
,
&
NewCallModelPimpl
::
slotVoiceMailNotify
);
#ifndef ENABLE_LIBWRAP
// Only necessary with dbus since the daemon runs separately
...
...
@@ -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
NewCallModel
::
hasCall
(
const
std
::
string
&
callId
)
const
{
...
...
src/qtwrapper/callmanager_wrap.h
View file @
1be57bd5
...
...
@@ -69,9 +69,9 @@ public:
Q_EMIT
recordPlaybackStopped
(
QString
(
filepath
.
c_str
()));
}),
exportable_callback
<
CallSignal
::
VoiceMailNotify
>
(
[
this
]
(
const
std
::
string
&
accountI
D
,
int
c
ount
)
{
LOG_DRING_SIGNAL
2
(
"voiceMailNotify"
,
QString
(
accountI
D
.
c_str
()),
c
ount
);
Q_EMIT
voiceMailNotify
(
QString
(
accountI
D
.
c_str
()),
c
ount
);
[
this
]
(
const
std
::
string
&
accountI
d
,
int
newCount
,
int
oldCount
,
int
urgentC
ount
)
{
LOG_DRING_SIGNAL
4
(
"voiceMailNotify"
,
QString
(
accountI
d
.
c_str
()),
newCount
,
oldCount
,
urgentC
ount
);
Q_EMIT
voiceMailNotify
(
QString
(
accountI
d
.
c_str
()),
newCount
,
oldCount
,
urgentC
ount
);
}),
exportable_callback
<
CallSignal
::
IncomingMessage
>
(
[
this
]
(
const
std
::
string
&
callID
,
const
std
::
string
&
from
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
message
)
{
...
...
@@ -373,7 +373,7 @@ Q_SIGNALS: // SIGNALS
void
transferFailed
();
void
transferSucceeded
();
void
recordPlaybackStopped
(
const
QString
&
filepath
);
void
voiceMailNotify
(
const
QString
&
accountI
D
,
int
c
ount
);
void
voiceMailNotify
(
const
QString
&
accountI
d
,
int
newCount
,
int
oldCount
,
int
urgentC
ount
);
void
incomingMessage
(
const
QString
&
callID
,
const
QString
&
from
,
const
MapStringString
&
message
);
void
incomingCall
(
const
QString
&
accountID
,
const
QString
&
callID
,
const
QString
&
from
);
void
recordPlaybackFilepath
(
const
QString
&
callID
,
const
QString
&
filepath
);
...
...
test/mocks/callmanager_mock.h
View file @
1be57bd5
...
...
@@ -302,7 +302,7 @@ Q_SIGNALS: // SIGNALS
void
transferFailed
();
void
transferSucceeded
();
void
recordPlaybackStopped
(
const
QString
&
filepath
);
void
voiceMailNotify
(
const
QString
&
accountI
D
,
int
c
ount
);
void
voiceMailNotify
(
const
QString
&
accountI
d
,
int
newCount
,
int
oldCount
,
int
urgentC
ount
);
void
incomingMessage
(
const
QString
&
callID
,
const
QString
&
from
,
const
MapStringString
&
message
);
void
incomingCall
(
const
QString
&
accountID
,
const
QString
&
callID
,
const
QString
&
from
);
void
recordPlaybackFilepath
(
const
QString
&
callID
,
const
QString
&
filepath
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment