mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 08:39:20 +00:00
fix(BasicToClientGroupChatRoom): Capabilities mask contains Migratable
This commit is contained in:
parent
5ff2076896
commit
30389fd9ab
5 changed files with 17 additions and 11 deletions
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _TRAITS_H_
|
||||
#define _TRAITS_H_
|
||||
|
||||
#include "general.h"
|
||||
#include "linphone/utils/general.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ namespace Utils {
|
|||
|
||||
LINPHONE_PUBLIC std::string stringToLower (const std::string &str);
|
||||
|
||||
// Return a buffer allocated with new.
|
||||
LINPHONE_PUBLIC char *utf8ToChar (uint32_t ic);
|
||||
|
||||
LINPHONE_PUBLIC inline std::string cStringToCppString (const char *str) {
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ private:
|
|||
BasicToClientGroupChatRoom::BasicToClientGroupChatRoom (const shared_ptr<ChatRoom> &chatRoom) :
|
||||
ProxyChatRoom(*new BasicToClientGroupChatRoomPrivate, chatRoom) {}
|
||||
|
||||
BasicToClientGroupChatRoom::CapabilitiesMask BasicToClientGroupChatRoom::getCapabilities () const {
|
||||
L_D();
|
||||
return d->chatRoom->getCapabilities() | BasicToClientGroupChatRoom::Capabilities::Migratable;
|
||||
}
|
||||
|
||||
shared_ptr<ChatMessage> BasicToClientGroupChatRoom::createChatMessage () {
|
||||
shared_ptr<ChatMessage> msg = ProxyChatRoom::createChatMessage();
|
||||
msg->getPrivate()->setChatRoom(getSharedFromThis());
|
||||
|
|
|
|||
|
|
@ -33,10 +33,15 @@ class LINPHONE_PUBLIC BasicToClientGroupChatRoom : public ProxyChatRoom {
|
|||
public:
|
||||
BasicToClientGroupChatRoom (const std::shared_ptr<ChatRoom> &chatRoom);
|
||||
|
||||
CapabilitiesMask getCapabilities () const override;
|
||||
|
||||
std::shared_ptr<ChatMessage> createChatMessage () override;
|
||||
std::shared_ptr<ChatMessage> createChatMessage (const std::string &text) override;
|
||||
|
||||
static void migrate(const std::shared_ptr<ClientGroupChatRoom> &clientGroupChatRoom, const std::shared_ptr<AbstractChatRoom> &chatRoom);
|
||||
static void migrate (
|
||||
const std::shared_ptr<ClientGroupChatRoom> &clientGroupChatRoom,
|
||||
const std::shared_ptr<AbstractChatRoom> &chatRoom
|
||||
);
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(BasicToClientGroupChatRoom);
|
||||
|
|
|
|||
|
|
@ -73,14 +73,11 @@ shared_ptr<AbstractChatRoom> CorePrivate::createBasicChatRoom (
|
|||
if (capabilities & ChatRoom::Capabilities::RealTimeText)
|
||||
chatRoom.reset(new RealTimeTextChatRoom(q->getSharedFromThis(), chatRoomId));
|
||||
else {
|
||||
bool isToMigrate = (capabilities & ChatRoom::Capabilities::Migratable);
|
||||
if (isToMigrate) {
|
||||
shared_ptr<BasicChatRoom> bcr;
|
||||
bcr.reset(new BasicChatRoom(q->getSharedFromThis(), chatRoomId));
|
||||
chatRoom.reset(new BasicToClientGroupChatRoom(bcr));
|
||||
} else {
|
||||
chatRoom.reset(new BasicChatRoom(q->getSharedFromThis(), chatRoomId));
|
||||
}
|
||||
BasicChatRoom *basicChatRoom = new BasicChatRoom(q->getSharedFromThis(), chatRoomId);
|
||||
if (capabilities & ChatRoom::Capabilities::Migratable)
|
||||
chatRoom.reset(new BasicToClientGroupChatRoom(shared_ptr<BasicChatRoom>(basicChatRoom)));
|
||||
else
|
||||
chatRoom.reset(basicChatRoom);
|
||||
}
|
||||
|
||||
AbstractChatRoomPrivate *dChatRoom = chatRoom->getPrivate();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue