Commit 601a1a65 authored by Ghislain MARY's avatar Ghislain MARY

The cpimFrom address field in the ChatMessage is useless.

parent 59177851
......@@ -57,9 +57,6 @@ public:
void setApplyModifiers (bool value) { applyModifiers = value; }
const Address &getCpimFromAddress () const { return cpimFrom; }
void setCpimFromAddress (const Address &addr);
void setDirection (ChatMessage::Direction dir);
void setState(ChatMessage::State state);
......@@ -129,7 +126,6 @@ private:
unsigned int storageId = 0;
Address from;
Address to;
Address cpimFrom;
time_t time = 0;
std::string id;
std::string appData;
......
......@@ -60,11 +60,6 @@ void ChatMessagePrivate::setChatRoom (shared_ptr<ChatRoom> cr) {
chatRoom = cr;
}
void ChatMessagePrivate::setCpimFromAddress (const Address &addr) {
cpimFrom = addr;
cpimFrom.clean();
}
void ChatMessagePrivate::setDirection (ChatMessage::Direction dir) {
direction = dir;
}
......
......@@ -557,7 +557,6 @@ shared_ptr<ChatMessage> ChatRoom::createMessage () {
shared_ptr<ChatMessage> chatMessage = ObjectFactory::create<ChatMessage>(getSharedFromThis());
chatMessage->setToAddress(d->peerAddress);
chatMessage->setFromAddress(Address(linphone_core_get_identity(d->core)));
chatMessage->getPrivate()->setCpimFromAddress(chatMessage->getFromAddress());
chatMessage->getPrivate()->setTime(ms_time(0));
return chatMessage;
}
......
......@@ -40,7 +40,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::encode (const shared_ptr<Ch
cpimMessage.addCpimHeader(cpimContentTypeHeader);
Cpim::FromHeader cpimFromHeader;
cpimFromHeader.setValue(cpimAddressAsString(message->getPrivate()->getCpimFromAddress()));
cpimFromHeader.setValue(cpimAddressAsString(message->getFromAddress()));
cpimMessage.addMessageHeader(cpimFromHeader);
Cpim::ToHeader cpimToHeader;
cpimToHeader.setValue(cpimAddressAsString(message->getToAddress()));
......@@ -133,7 +133,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::decode (const shared_ptr<Ch
// Modify the initial message since there was no error
message->setInternalContent(newContent);
if (cpimFromAddress.isValid())
message->getPrivate()->setCpimFromAddress(cpimFromAddress);
message->setFromAddress(cpimFromAddress);
if (cpimToAddress.isValid())
message->setToAddress(cpimToAddress);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment