mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Various fixes regarding callbacks of chat rooms.
This commit is contained in:
parent
8ddd7ad309
commit
5290d59d76
8 changed files with 16 additions and 13 deletions
|
|
@ -84,8 +84,8 @@ LinphoneChatRoom *linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneA
|
|||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
}
|
||||
|
||||
LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject) {
|
||||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject)));
|
||||
LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject, bool_t fallback) {
|
||||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject), !!fallback));
|
||||
}
|
||||
|
||||
LinphoneChatRoom *_linphone_core_create_server_group_chat_room (LinphoneCore *lc, LinphonePrivate::SalCallOp *op) {
|
||||
|
|
|
|||
|
|
@ -4976,13 +4976,14 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC const char *linphone_core_get_chat_database_
|
|||
|
||||
/**
|
||||
* Create a client-side group chat room. When calling this function the chat room is only created
|
||||
* at the client-side and is empty. Pou need to call linphone_chat_room_add_participants() to
|
||||
* at the client-side and is empty. You need to call linphone_chat_room_add_participants() to
|
||||
* create at the server side and add participants to it.
|
||||
* @param[in] lc A #LinphoneCore object
|
||||
* @param[in] subject The subject of the group chat room
|
||||
* @param[in] fallback Boolean value telling whether we should plan on being able to fallback to a basic chat room if the client-side group chat room creation fails
|
||||
* @return The newly created client-side group chat room.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, const char *subject);
|
||||
LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, const char *subject, bool_t fallback);
|
||||
|
||||
/**
|
||||
* Get a basic chat room whose peer is the supplied address. If it does not exist yet, it will be created.
|
||||
|
|
|
|||
|
|
@ -442,6 +442,7 @@ const bctbx_list_t *linphone_chat_room_get_callbacks_list(const LinphoneChatRoom
|
|||
if (cb) \
|
||||
cb(__VA_ARGS__); \
|
||||
} \
|
||||
linphone_chat_room_set_current_callbacks(cr, nullptr); \
|
||||
bctbx_list_free(callbacksCopy);
|
||||
|
||||
void _linphone_chat_room_notify_is_composing_received(LinphoneChatRoom *cr, const LinphoneAddress *remoteAddr, bool_t isComposing) {
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ static void forceUtf8Content (Content &content) {
|
|||
void ChatMessagePrivate::notifyReceiving () {
|
||||
L_Q();
|
||||
|
||||
LinphoneChatRoom *chatRoom = L_GET_C_BACK_PTR(q->getChatRoom());
|
||||
LinphoneChatRoom *chatRoom = static_pointer_cast<ChatRoom>(q->getChatRoom())->getPrivate()->getCChatRoom();
|
||||
if ((getContentType() != ContentType::Imdn) && (getContentType() != ContentType::ImIsComposing)) {
|
||||
_linphone_chat_room_notify_chat_message_should_be_stored(chatRoom, L_GET_C_BACK_PTR(q->getSharedFromThis()));
|
||||
if (toBeStored)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class ChatRoomPrivate;
|
|||
|
||||
class LINPHONE_PUBLIC ChatRoom : public AbstractChatRoom {
|
||||
public:
|
||||
friend class ChatMessagePrivate;
|
||||
friend class ProxyChatRoomPrivate;
|
||||
|
||||
L_OVERRIDE_SHARED_FROM_THIS(ChatRoom);
|
||||
|
|
|
|||
|
|
@ -265,9 +265,9 @@ shared_ptr<AbstractChatRoom> Core::findOneToOneChatRoom (
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
shared_ptr<AbstractChatRoom> Core::createClientGroupChatRoom (const string &subject) {
|
||||
shared_ptr<AbstractChatRoom> Core::createClientGroupChatRoom (const string &subject, bool fallback) {
|
||||
L_D();
|
||||
return d->createClientGroupChatRoom(subject);
|
||||
return d->createClientGroupChatRoom(subject, "", Content(), fallback);
|
||||
}
|
||||
|
||||
shared_ptr<AbstractChatRoom> Core::getOrCreateBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public:
|
|||
const IdentityAddress &participantAddress
|
||||
) const;
|
||||
|
||||
std::shared_ptr<AbstractChatRoom> createClientGroupChatRoom (const std::string &subject);
|
||||
std::shared_ptr<AbstractChatRoom> createClientGroupChatRoom (const std::string &subject, bool fallback = true);
|
||||
std::shared_ptr<AbstractChatRoom> createClientGroupChatRoom (
|
||||
const std::string &subject,
|
||||
const IdentityAddress &localAddress
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ static LinphoneChatRoom * check_creation_chat_room_client_side(bctbx_list_t *lcs
|
|||
}
|
||||
|
||||
static LinphoneChatRoom * create_chat_room_client_side(bctbx_list_t *lcs, LinphoneCoreManager *lcm, stats *initialStats, bctbx_list_t *participantsAddresses, const char* initialSubject, int expectedParticipantSize) {
|
||||
LinphoneChatRoom *chatRoom = linphone_core_create_client_group_chat_room(lcm->lc, initialSubject);
|
||||
LinphoneChatRoom *chatRoom = linphone_core_create_client_group_chat_room(lcm->lc, initialSubject, FALSE);
|
||||
if (!chatRoom) return NULL;
|
||||
|
||||
BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateInstantiated, initialStats->number_of_LinphoneChatRoomStateInstantiated + 1, 100));
|
||||
|
|
@ -2139,7 +2139,7 @@ static void group_chat_room_fallback_to_basic_chat_room (void) {
|
|||
stats initialPaulineStats = pauline->stat;
|
||||
|
||||
// Marie creates a new group chat room
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback");
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback", TRUE);
|
||||
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100));
|
||||
|
||||
// Add participants
|
||||
|
|
@ -2195,13 +2195,13 @@ static void group_chat_room_creation_fails_if_invited_participants_dont_support_
|
|||
stats initialMarieStats = marie->stat;
|
||||
|
||||
// Marie creates a new group chat room
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Hello there");
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Hello there", FALSE);
|
||||
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100));
|
||||
|
||||
// Add participants
|
||||
linphone_chat_room_add_participants(marieCr, participantsAddresses);
|
||||
|
||||
// Check that the group chat room creation fails and that a fallback to a basic chat room is done
|
||||
// Check that the group chat room creation fails
|
||||
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarieStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000));
|
||||
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationFailed, initialMarieStats.number_of_LinphoneChatRoomStateCreationFailed + 1, 10000));
|
||||
bctbx_list_free_with_data(participantsAddresses, (bctbx_list_free_func)linphone_address_unref);
|
||||
|
|
@ -2367,7 +2367,7 @@ static void group_chat_room_migrate_from_basic_to_client_fail (void) {
|
|||
stats initialPaulineStats = pauline->stat;
|
||||
|
||||
// Marie creates a new group chat room
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback");
|
||||
LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback", TRUE);
|
||||
BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100));
|
||||
|
||||
// Add participants
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue