mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 22:58:13 +00:00
Fixed old API setText and setContentType on ChatMessage
This commit is contained in:
parent
e1c7e698dc
commit
1f2f1deb5e
2 changed files with 18 additions and 1 deletions
|
|
@ -50,7 +50,8 @@ public:
|
|||
FileUpload = 1 << 1,
|
||||
Multipart = 1 << 2,
|
||||
Encryption = 1 << 3,
|
||||
Cpim = 1 << 4
|
||||
Cpim = 1 << 4,
|
||||
Started = 1 << 5,
|
||||
};
|
||||
|
||||
ChatMessagePrivate () = default;
|
||||
|
|
|
|||
|
|
@ -240,6 +240,12 @@ void ChatMessagePrivate::setContentType (const ContentType &contentType) {
|
|||
internalContent.setBody(contents.front()->getBody());
|
||||
}
|
||||
internalContent.setContentType(contentType);
|
||||
|
||||
if ((currentSendStep &ChatMessagePrivate::Step::Started) != ChatMessagePrivate::Step::Started) {
|
||||
// if not started yet the sending also alter the first content
|
||||
if (contents.size() > 0)
|
||||
contents.front()->setContentType(contentType);
|
||||
}
|
||||
}
|
||||
|
||||
const string &ChatMessagePrivate::getText () {
|
||||
|
|
@ -272,6 +278,12 @@ void ChatMessagePrivate::setText (const string &text) {
|
|||
internalContent.setContentType(contents.front()->getContentType());
|
||||
}
|
||||
internalContent.setBody(text);
|
||||
|
||||
if ((currentSendStep &ChatMessagePrivate::Step::Started) != ChatMessagePrivate::Step::Started) {
|
||||
// if not started yet the sending also alter the first content
|
||||
if (contents.size() > 0)
|
||||
contents.front()->setBody(text);
|
||||
}
|
||||
}
|
||||
|
||||
LinphoneContent *ChatMessagePrivate::getFileTransferInformation () const {
|
||||
|
|
@ -515,6 +527,8 @@ void ChatMessagePrivate::send () {
|
|||
LinphoneCall *lcall = nullptr;
|
||||
int errorCode = 0;
|
||||
|
||||
currentSendStep |= ChatMessagePrivate::Step::Started;
|
||||
|
||||
storeInDb();
|
||||
|
||||
if ((currentSendStep & ChatMessagePrivate::Step::FileUpload) == ChatMessagePrivate::Step::FileUpload) {
|
||||
|
|
@ -658,6 +672,8 @@ void ChatMessagePrivate::send () {
|
|||
// Remove internal content as it is not needed anymore and will confuse some old methods like getContentType()
|
||||
internalContent.setBody("");
|
||||
internalContent.setContentType(ContentType(""));
|
||||
// Also remove current step so we go through all modifiers if message is re-sent
|
||||
currentSendStep = ChatMessagePrivate::Step::None;
|
||||
|
||||
if (imdnId.empty())
|
||||
setImdnMessageId(op->get_call_id()); /* must be known at that time */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue