mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 11:38:08 +00:00
Fixed ChatMessage legacy getContentType and getText methods
This commit is contained in:
parent
004d774180
commit
4bbf7f1fb0
2 changed files with 14 additions and 6 deletions
|
|
@ -137,8 +137,12 @@ string ChatMessagePrivate::getSalCustomHeaderValue(const string& name) {
|
|||
|
||||
const string& ChatMessagePrivate::getContentType() {
|
||||
if (internalContent) {
|
||||
ContentType contentType = internalContent->getContentType();
|
||||
cContentType = contentType.asString();
|
||||
cContentType = internalContent->getContentType().asString();
|
||||
} else {
|
||||
if (contents.size() > 0) {
|
||||
shared_ptr<Content> content = contents.front();
|
||||
cContentType = content->getContentType().asString();
|
||||
}
|
||||
}
|
||||
return cContentType;
|
||||
}
|
||||
|
|
@ -153,6 +157,11 @@ void ChatMessagePrivate::setContentType(const string& contentType) {
|
|||
const string& ChatMessagePrivate::getText() {
|
||||
if (internalContent) {
|
||||
cText = internalContent->getBodyAsString();
|
||||
} else {
|
||||
if (contents.size() > 0) {
|
||||
shared_ptr<Content> content = contents.front();
|
||||
cText = content->getBodyAsString();
|
||||
}
|
||||
}
|
||||
return cText;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -580,14 +580,10 @@ void ChatRoom::compose () {
|
|||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) {
|
||||
L_D();
|
||||
|
||||
shared_ptr<ChatMessage> chatMessage = createMessage();
|
||||
|
||||
chatMessage->getPrivate()->setDirection(ChatMessage::Direction::Outgoing);
|
||||
chatMessage->getPrivate()->setFileTransferInformation(linphone_content_copy(initialContent));
|
||||
chatMessage->setToAddress(d->peerAddress);
|
||||
chatMessage->setFromAddress(linphone_core_get_identity(d->core));
|
||||
|
||||
return chatMessage;
|
||||
}
|
||||
|
|
@ -604,8 +600,11 @@ shared_ptr<ChatMessage> ChatRoom::createMessage (const string &message) {
|
|||
}
|
||||
|
||||
shared_ptr<ChatMessage> ChatRoom::createMessage () {
|
||||
L_D();
|
||||
shared_ptr<ChatMessage> chatMessage = make_shared<ChatMessage>(static_pointer_cast<ChatRoom>(shared_from_this()));
|
||||
chatMessage->getPrivate()->setTime(ms_time(0));
|
||||
chatMessage->setToAddress(d->peerAddress);
|
||||
chatMessage->setFromAddress(linphone_core_get_identity(d->core));
|
||||
return chatMessage;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue