mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 13:48:09 +00:00
Add a callback on the ChatRoom to generate the conference address.
This commit is contained in:
parent
b12a245ed9
commit
d4d88312ae
7 changed files with 55 additions and 0 deletions
|
|
@ -226,6 +226,14 @@ typedef void (*LinphoneChatRoomCbsParticipantDeviceAddedCb) (LinphoneChatRoom *c
|
|||
* @param[in] participant The #LinphoneParticipant that has been removed from the chat room
|
||||
*/
|
||||
typedef void (*LinphoneChatRoomCbsParticipantDeviceRemovedCb) (LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
|
||||
/**
|
||||
* Callback used when a group chat room is created server-side to generate the address of the chat room.
|
||||
* The function linphone_chat_room_set_conference_address() needs to be called by this callback.
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
*/
|
||||
typedef void (*LinphoneChatRoomCbsConferenceAddressGenerationCb) (LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* @}
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -228,6 +228,21 @@ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceRemovedCb linphone_chat_room
|
|||
* @param[in] cb The participant device removed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceRemovedCb cb);
|
||||
|
||||
/**
|
||||
* Get the conference address generation callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @return The current conference address generation callback
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsConferenceAddressGenerationCb linphone_chat_room_cbs_get_conference_address_generation (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the conference address generation callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cb The conference address generation callback to be used
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_conference_address_generation (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceAddressGenerationCb cb);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -366,6 +366,14 @@ LINPHONE_PUBLIC void linphone_chat_room_set_subject (LinphoneChatRoom *cr, const
|
|||
*/
|
||||
LINPHONE_PUBLIC bctbx_list_t * linphone_chat_room_get_composing_addresses(LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Set the conference address of a group chat room. This function needs to be called from the
|
||||
* LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] confAddr The conference address to be used by the group chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_set_conference_address (LinphoneChatRoom *cr, const LinphoneAddress *confAddr);
|
||||
|
||||
/**
|
||||
* Returns back pointer to #LinphoneCore object.
|
||||
* @deprecated use linphone_chat_room_get_core()
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct _LinphoneChatRoomCbs {
|
|||
LinphoneChatRoomCbsUndecryptableMessageReceivedCb undecryptableMessageReceivedCb;
|
||||
LinphoneChatRoomCbsChatMessageReceivedCb chatMessageReceivedCb;
|
||||
LinphoneChatRoomCbsChatMessageSentCb chatMessageSentCb;
|
||||
LinphoneChatRoomCbsConferenceAddressGenerationCb conferenceAddressGenerationCb;
|
||||
};
|
||||
|
||||
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneChatRoomCbs);
|
||||
|
|
@ -169,3 +170,11 @@ LinphoneChatRoomCbsParticipantDeviceRemovedCb linphone_chat_room_cbs_get_partici
|
|||
void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceRemovedCb cb) {
|
||||
cbs->participantDeviceRemovedCb = cb;
|
||||
}
|
||||
|
||||
LinphoneChatRoomCbsConferenceAddressGenerationCb linphone_chat_room_cbs_get_conference_address_generation (const LinphoneChatRoomCbs *cbs) {
|
||||
return cbs->conferenceAddressGenerationCb;
|
||||
}
|
||||
|
||||
void linphone_chat_room_cbs_set_conference_address_generation (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceAddressGenerationCb cb) {
|
||||
cbs->conferenceAddressGenerationCb = cb;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "linphone/wrapper_utils.h"
|
||||
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
#include "address/identity-address.h"
|
||||
#include "chat/chat-room/basic-chat-room.h"
|
||||
#include "chat/chat-room/client-group-chat-room.h"
|
||||
#include "chat/chat-room/real-time-text-chat-room-p.h"
|
||||
|
|
@ -309,6 +310,14 @@ LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneCha
|
|||
return object;
|
||||
}
|
||||
|
||||
void linphone_chat_room_set_conference_address (LinphoneChatRoom *cr, const LinphoneAddress *confAddr) {
|
||||
char *addrStr = linphone_address_as_string(confAddr);
|
||||
LinphonePrivate::ServerGroupChatRoomPrivate *sgcr = dynamic_cast<LinphonePrivate::ServerGroupChatRoomPrivate *>(L_GET_PRIVATE_FROM_C_OBJECT(cr));
|
||||
if (sgcr)
|
||||
sgcr->setConferenceAddress(LinphonePrivate::IdentityAddress(addrStr));
|
||||
bctbx_free(addrStr);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Reference and user data handling functions.
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -49,9 +49,11 @@ public:
|
|||
void dispatchMessage (const Address &fromAddr, const Content &content);
|
||||
void storeOrUpdateMessage (const std::shared_ptr<ChatMessage> &msg) override;
|
||||
LinphoneReason messageReceived (SalOp *op, const SalMessage *msg) override;
|
||||
void setConferenceAddress (const IdentityAddress &confAddr);
|
||||
|
||||
private:
|
||||
void designateAdmin ();
|
||||
void finalizeCreation ();
|
||||
bool isAdminLeft () const;
|
||||
|
||||
std::list<std::shared_ptr<Participant>> removedParticipants;
|
||||
|
|
|
|||
|
|
@ -63,10 +63,14 @@ LinphoneReason ServerGroupChatRoomPrivate::messageReceived (SalOp *, const SalMe
|
|||
return LinphoneReasonNone;
|
||||
}
|
||||
|
||||
void ServerGroupChatRoomPrivate::setConferenceAddress (const IdentityAddress &confAddr) {}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ServerGroupChatRoomPrivate::designateAdmin () {}
|
||||
|
||||
void ServerGroupChatRoomPrivate::finalizeCreation () {}
|
||||
|
||||
bool ServerGroupChatRoomPrivate::isAdminLeft () const {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue