mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
- Reset all counts when requested
- Add an interface to reset count when the GUI need it - Replace handler event name to be more specific on what it is doing and make a new connection when ChatModel request to reset the count
This commit is contained in:
parent
0b0aa40cb3
commit
cdd06c4e05
5 changed files with 10 additions and 8 deletions
|
|
@ -638,9 +638,8 @@ void ChatModel::compose () {
|
|||
void ChatModel::resetMessageCount () {
|
||||
if (mChatRoom->getUnreadMessagesCount() > 0){
|
||||
mChatRoom->markAsRead();// Marking as read is only for messages. Not for calls.
|
||||
emit messageCountReset();
|
||||
}else if (CoreManager::getInstance()->getMissedCallCount(getPeerAddress(), getLocalAddress())>0)
|
||||
emit messageCountReset();
|
||||
}
|
||||
emit messageCountReset();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -209,8 +209,6 @@ void ChatProxyModel::reload () {
|
|||
mChatModel = CoreManager::getInstance()->getChatModel(mPeerAddress, mLocalAddress);
|
||||
|
||||
if (mChatModel) {
|
||||
mChatModel->resetMessageCount();
|
||||
mChatModel->focused();
|
||||
|
||||
ChatModel *chatModel = mChatModel.get();
|
||||
QObject::connect(chatModel, &ChatModel::isRemoteComposingChanged, this, &ChatProxyModel::handleIsRemoteComposingChanged);
|
||||
|
|
@ -220,7 +218,11 @@ void ChatProxyModel::reload () {
|
|||
|
||||
static_cast<ChatModelFilter *>(sourceModel())->setSourceModel(mChatModel.get());
|
||||
}
|
||||
|
||||
void ChatProxyModel::resetMessageCount(){
|
||||
if( mChatModel){
|
||||
mChatModel->resetMessageCount();
|
||||
}
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static inline QWindow *getParentWindow (QObject *object) {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
Q_INVOKABLE void compose ();
|
||||
|
||||
Q_INVOKABLE void resetMessageCount();
|
||||
|
||||
signals:
|
||||
void peerAddressChanged (const QString &peerAddress);
|
||||
void localAddressChanged (const QString &localAddress);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ void AbstractEventCountNotifier::handleResetAllMissedCalls () {
|
|||
internalnotifyEventCount();
|
||||
}
|
||||
|
||||
|
||||
void AbstractEventCountNotifier::handleResetMissedCalls (ChatModel *chatModel) {
|
||||
auto it = mMissedCalls.find({ Utils::cleanSipAddress(chatModel->getPeerAddress()), Utils::cleanSipAddress(chatModel->getLocalAddress()) });
|
||||
if (it != mMissedCalls.cend()) {
|
||||
|
|
@ -129,7 +128,6 @@ void AbstractEventCountNotifier::handleResetMissedCalls (ChatModel *chatModel) {
|
|||
internalnotifyEventCount();
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractEventCountNotifier::handleCallMissed (CallModel *callModel) {
|
||||
++mMissedCalls[{ Utils::cleanSipAddress(callModel->getPeerAddress()), Utils::cleanSipAddress(callModel->getLocalAddress()) }];
|
||||
internalnotifyEventCount();
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ ColumnLayout {
|
|||
if (!SettingsModel.chatEnabled) {
|
||||
setEntryTypeFilter(ChatModel.CallEntry)
|
||||
}
|
||||
resetMessageCount()
|
||||
}
|
||||
|
||||
peerAddress: conversation.peerAddress
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue