diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 8b758762c..a26c1ca90 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -411,9 +411,16 @@ string ChatMessagePrivate::createImdnXml (Imdn::Type imdnType, LinphoneReason re } void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) { - // FIXME: Add impl. - // L_Q(); - // q->getChatRoom()->getPrivate()->sendImdn(createImdnXml(imdnType, reason), reason); + L_Q(); + + shared_ptr msg = q->getChatRoom()->createMessage(); + + Content *content = new Content(); + content->setContentType("message/imdn+xml"); + content->setBody(createImdnXml(imdnType, reason)); + msg->addContent(*content); + + msg->send(); } LinphoneReason ChatMessagePrivate::receive () { diff --git a/src/chat/chat-room/chat-room-p.h b/src/chat/chat-room/chat-room-p.h index be04ac5be..650b7d3b6 100644 --- a/src/chat/chat-room/chat-room-p.h +++ b/src/chat/chat-room/chat-room-p.h @@ -47,7 +47,6 @@ public: void removeTransientMessage (const std::shared_ptr &msg); void release (); - void sendImdn (const std::string &content, LinphoneReason reason); void setState (ChatRoom::State newState); diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index cc9b2e5b7..27e11113b 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -83,54 +83,6 @@ void ChatRoomPrivate::release () { message->cancelFileTransfer(); } -void ChatRoomPrivate::sendImdn (const string &payload, LinphoneReason reason) { - // L_Q(); - // - // shared_ptr core = q->getCore(); - // LinphoneCore *cCore = core->getCCore(); - // - // // TODO: Use ChatRoomId. - // const char *identity = nullptr; - // LinphoneAddress *peer = linphone_address_new(q->getPeerAddress().asString().c_str()); - // LinphoneProxyConfig *proxy = linphone_core_lookup_known_proxy(cCore, peer); - // if (proxy) - // identity = linphone_address_as_string(linphone_proxy_config_get_identity_address(proxy)); - // else - // identity = linphone_core_get_primary_contact(cCore); - // - // /* Sending out of call */ - // SalMessageOp *op = new SalMessageOp(cCore->sal); - // linphone_configure_op(cCore, op, peer, nullptr, !!lp_config_get_int(cCore->config, "sip", "chat_msg_with_contact", 0)); - // - // // shared_ptr msg = createChatMessage( - // // ChatMessage::Direction::Outgoing, - // // ChatRoomId(q->getPeerAddress(), Address(identity)) - // // ); - // - // Content *content = new Content(); - // content->setContentType("message/imdn+xml"); - // content->setBody(payload); - // msg->addContent(*content); - // - // /* Do not try to encrypt the notification when it is reporting an error (maybe it should be bypassed only for some reasons). */ - // int retval = -1; - // LinphoneImEncryptionEngine *imee = linphone_core_get_im_encryption_engine(cCore); - // if (imee && (reason == LinphoneReasonNone)) { - // LinphoneImEncryptionEngineCbs *imeeCbs = linphone_im_encryption_engine_get_callbacks(imee); - // LinphoneImEncryptionEngineCbsOutgoingMessageCb cbProcessOutgoingMessage = linphone_im_encryption_engine_cbs_get_process_outgoing_message(imeeCbs); - // if (cbProcessOutgoingMessage) { - // retval = cbProcessOutgoingMessage(imee, L_GET_C_BACK_PTR(q), L_GET_C_BACK_PTR(msg)); - // } - // } - // - // if (retval <= 0) { - // op->send_message(identity, q->getPeerAddress().asString().c_str(), msg->getPrivate()->getContentType().asString().c_str(), msg->getPrivate()->getText().c_str(), nullptr); - // } - // - // linphone_address_unref(peer); - // op->unref(); -} - // ----------------------------------------------------------------------------- void ChatRoomPrivate::setState (ChatRoom::State newState) {