Commit 361b4c76 authored by Benjamin REIS's avatar Benjamin REIS

Revert "Fix last notify id in DB when inserting a client group chat room."

This reverts commit f2910f7d.
parent f2910f7d
......@@ -41,7 +41,6 @@ class LINPHONE_PUBLIC AbstractChatRoom : public Object, public CoreAccessor, pub
friend class Core;
friend class CorePrivate;
friend class MainDb;
friend class MainDbPrivate;
friend class ProxyChatRoomPrivate;
public:
......
......@@ -38,8 +38,6 @@ public:
void setCallSessionListener (CallSessionListener *listener);
void setChatRoomListener (ChatRoomListener *listener) { chatRoomListener = listener; }
unsigned int getLastNotifyId () const;
// ChatRoomListener
void onChatRoomInsertRequested (const std::shared_ptr<AbstractChatRoom> &chatRoom) override;
void onChatRoomInsertInDatabaseRequested (const std::shared_ptr<AbstractChatRoom> &chatRoom) override;
......
......@@ -103,12 +103,6 @@ void ClientGroupChatRoomPrivate::setCallSessionListener (CallSessionListener *li
}
}
unsigned int ClientGroupChatRoomPrivate::getLastNotifyId () const {
L_Q_T(RemoteConference, qConference);
return qConference->getPrivate()->eventHandler->getLastNotify();
}
// -----------------------------------------------------------------------------
void ClientGroupChatRoomPrivate::onChatRoomInsertRequested (const shared_ptr<AbstractChatRoom> &chatRoom) {
......
......@@ -24,7 +24,7 @@
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/chat-room-p.h"
#include "chat/chat-room/client-group-chat-room-p.h"
#include "chat/chat-room/client-group-chat-room.h"
#include "chat/chat-room/server-group-chat-room.h"
#include "conference/participant-device.h"
#include "conference/participant-p.h"
......@@ -333,23 +333,13 @@ long long MainDbPrivate::insertChatRoom (const shared_ptr<AbstractChatRoom> &cha
// Remove capabilities like `Proxy`.
const int &capabilities = chatRoom->getCapabilities() & ~ChatRoom::CapabilitiesMask(ChatRoom::Capabilities::Proxy);
unsigned int lastNotifyId = 0;
if (!linphone_core_conference_server_enabled(chatRoom->getCore()->getCCore())
&& (chatRoom->getCapabilities() & ChatRoom::Capabilities::Conference)
)
lastNotifyId = static_cast<ClientGroupChatRoomPrivate *>(chatRoom->getPrivate())->getLastNotifyId();
const string &subject = chatRoom->getSubject();
const int &flags = chatRoom->hasBeenLeft();
*dbSession.getBackendSession() << "INSERT INTO chat_room ("
" peer_sip_address_id, local_sip_address_id, creation_time,"
" last_update_time, capabilities, subject, flags, last_notify_id"
") VALUES ("
" :peerSipAddressId, :localSipAddressId, :creationTime,"
" :lastUpdateTime, :capabilities, :subject, :flags, :lastNotifyId"
")",
soci::use(peerSipAddressId), soci::use(localSipAddressId), soci::use(creationTime),
soci::use(lastUpdateTime), soci::use(capabilities), soci::use(subject), soci::use(flags), soci::use(lastNotifyId);
" peer_sip_address_id, local_sip_address_id, creation_time, last_update_time, capabilities, subject, flags"
") VALUES (:peerSipAddressId, :localSipAddressId, :creationTime, :lastUpdateTime, :capabilities, :subject, :flags)",
soci::use(peerSipAddressId), soci::use(localSipAddressId), soci::use(creationTime), soci::use(lastUpdateTime),
soci::use(capabilities), soci::use(subject), soci::use(flags);
id = dbSession.getLastInsertId();
if (!chatRoom->canHandleParticipants())
......
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