mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-22 23:48:36 +00:00
setImdnMessageId is now private
This commit is contained in:
parent
f31f9150f6
commit
7d6fc05459
7 changed files with 15 additions and 15 deletions
|
|
@ -151,7 +151,7 @@ const char* linphone_chat_message_get_message_id(const LinphoneChatMessage *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void linphone_chat_message_set_message_id(LinphoneChatMessage *msg, char *id) {
|
void linphone_chat_message_set_message_id(LinphoneChatMessage *msg, char *id) {
|
||||||
L_GET_CPP_PTR_FROM_C_OBJECT(msg)->setImdnMessageId(L_C_TO_STRING(id));
|
L_GET_PRIVATE_FROM_C_OBJECT(msg)->setImdnMessageId(L_C_TO_STRING(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t linphone_chat_message_is_read(LinphoneChatMessage *msg) {
|
bool_t linphone_chat_message_is_read(LinphoneChatMessage *msg) {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,8 @@ public:
|
||||||
|
|
||||||
void setIsReadOnly(bool readOnly);
|
void setIsReadOnly(bool readOnly);
|
||||||
|
|
||||||
|
void setImdnMessageId (const std::string &imdnMessageId);
|
||||||
|
|
||||||
inline void forceFromAddress (const IdentityAddress &fromAddress) {
|
inline void forceFromAddress (const IdentityAddress &fromAddress) {
|
||||||
this->fromAddress = fromAddress;
|
this->fromAddress = fromAddress;
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +129,7 @@ public:
|
||||||
private:
|
private:
|
||||||
// TODO: Clean attributes.
|
// TODO: Clean attributes.
|
||||||
time_t time = ::ms_time(0); // TODO: Change me in all files.
|
time_t time = ::ms_time(0); // TODO: Change me in all files.
|
||||||
std::string id;
|
std::string imdnId;
|
||||||
std::string rttMessage;
|
std::string rttMessage;
|
||||||
bool isSecured = false;
|
bool isSecured = false;
|
||||||
bool isReadOnly = false;
|
bool isReadOnly = false;
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) {
|
||||||
|
|
||||||
Content *content = new Content();
|
Content *content = new Content();
|
||||||
content->setContentType("message/imdn+xml");
|
content->setContentType("message/imdn+xml");
|
||||||
content->setBody(Imdn::createXml(id, time, imdnType, reason));
|
content->setBody(Imdn::createXml(imdnId, time, imdnType, reason));
|
||||||
msg->addContent(*content);
|
msg->addContent(*content);
|
||||||
|
|
||||||
msg->getPrivate()->send();
|
msg->getPrivate()->send();
|
||||||
|
|
@ -416,7 +416,7 @@ LinphoneReason ChatMessagePrivate::receive () {
|
||||||
setDirection(ChatMessage::Direction::Outgoing);
|
setDirection(ChatMessage::Direction::Outgoing);
|
||||||
|
|
||||||
// Check if this is a duplicate message.
|
// Check if this is a duplicate message.
|
||||||
if (chatRoom && chatRoom->findMessageWithDirection(q->getImdnMessageId(), direction))
|
if (chatRoom && chatRoom->findMessageWithDirection(imdnId, direction))
|
||||||
return core->getCCore()->chat_deny_code;
|
return core->getCCore()->chat_deny_code;
|
||||||
|
|
||||||
if (errorCode > 0) {
|
if (errorCode > 0) {
|
||||||
|
|
@ -558,8 +558,8 @@ void ChatMessagePrivate::send () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q->getImdnMessageId().empty())
|
if (imdnId.empty())
|
||||||
q->setImdnMessageId(op->get_call_id()); /* must be known at that time */
|
setImdnMessageId(op->get_call_id()); /* must be known at that time */
|
||||||
|
|
||||||
//store(); // Store will be done right below in the setState(InProgress)
|
//store(); // Store will be done right below in the setState(InProgress)
|
||||||
|
|
||||||
|
|
@ -692,12 +692,11 @@ ChatMessage::State ChatMessage::getState () const {
|
||||||
|
|
||||||
const string &ChatMessage::getImdnMessageId () const {
|
const string &ChatMessage::getImdnMessageId () const {
|
||||||
L_D();
|
L_D();
|
||||||
return d->id;
|
return d->imdnId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatMessage::setImdnMessageId (const string &id) {
|
void ChatMessagePrivate::setImdnMessageId (const string &id) {
|
||||||
L_D();
|
imdnId = id;
|
||||||
d->id = id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatMessage::isRead () const {
|
bool ChatMessage::isRead () const {
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ public:
|
||||||
void updateState (State state);
|
void updateState (State state);
|
||||||
void sendDeliveryNotification (LinphoneReason reason);
|
void sendDeliveryNotification (LinphoneReason reason);
|
||||||
void sendDisplayNotification ();
|
void sendDisplayNotification ();
|
||||||
void setImdnMessageId (const std::string &imdnMessageId);
|
|
||||||
void setIsSecured (bool isSecured);
|
void setIsSecured (bool isSecured);
|
||||||
// ----- TODO: Remove me.
|
// ----- TODO: Remove me.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ LinphoneReason ChatRoomPrivate::messageReceived (SalOp *op, const SalMessage *sa
|
||||||
msg->setInternalContent(content);
|
msg->setInternalContent(content);
|
||||||
|
|
||||||
msg->getPrivate()->setTime(salMsg->time);
|
msg->getPrivate()->setTime(salMsg->time);
|
||||||
msg->setImdnMessageId(op->get_call_id());
|
msg->getPrivate()->setImdnMessageId(op->get_call_id());
|
||||||
|
|
||||||
const SalCustomHeader *ch = op->get_recv_custom_header();
|
const SalCustomHeader *ch = op->get_recv_custom_header();
|
||||||
if (ch)
|
if (ch)
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::encode (const shared_ptr<Ch
|
||||||
Cpim::MessageIdHeader cpimMessageIdHeader;
|
Cpim::MessageIdHeader cpimMessageIdHeader;
|
||||||
cpimMessageIdHeader.setValue(token);
|
cpimMessageIdHeader.setValue(token);
|
||||||
cpimMessage.addMessageHeader(cpimMessageIdHeader);
|
cpimMessage.addMessageHeader(cpimMessageIdHeader);
|
||||||
message->setImdnMessageId(token);
|
message->getPrivate()->setImdnMessageId(token);
|
||||||
|
|
||||||
const Content *content;
|
const Content *content;
|
||||||
if (!message->getInternalContent().isEmpty()) {
|
if (!message->getInternalContent().isEmpty()) {
|
||||||
|
|
@ -134,7 +134,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::decode (const shared_ptr<Ch
|
||||||
else if (header->getName() == "To")
|
else if (header->getName() == "To")
|
||||||
cpimToAddress = Address(header->getValue());
|
cpimToAddress = Address(header->getValue());
|
||||||
else if (header->getName() == "Message-ID")
|
else if (header->getName() == "Message-ID")
|
||||||
message->setImdnMessageId(header->getValue());
|
message->getPrivate()->setImdnMessageId(header->getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,6 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
||||||
static_cast<ChatMessage::Direction>(direction)
|
static_cast<ChatMessage::Direction>(direction)
|
||||||
));
|
));
|
||||||
chatMessage->setIsSecured(static_cast<bool>(isSecured));
|
chatMessage->setIsSecured(static_cast<bool>(isSecured));
|
||||||
chatMessage->setImdnMessageId(imdnMessageId);
|
|
||||||
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
|
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
|
||||||
dChatMessage->setState(static_cast<ChatMessage::State>(state), true);
|
dChatMessage->setState(static_cast<ChatMessage::State>(state), true);
|
||||||
|
|
||||||
|
|
@ -528,6 +527,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
||||||
dChatMessage->forceToAddress(IdentityAddress(toSipAddress));
|
dChatMessage->forceToAddress(IdentityAddress(toSipAddress));
|
||||||
|
|
||||||
dChatMessage->setTime(Utils::getTmAsTimeT(messageTime));
|
dChatMessage->setTime(Utils::getTmAsTimeT(messageTime));
|
||||||
|
dChatMessage->setImdnMessageId(imdnMessageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2 - Fetch contents.
|
// 2 - Fetch contents.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue