[headless] don't use putAll for a single field

This commit is contained in:
Torsten Grote
2018-11-07 15:22:52 -03:00
parent 8b3983ef9e
commit efc85fb88f

View File

@@ -23,13 +23,10 @@ internal fun ConversationMessageHeader.output(contactId: ContactId, text: String
return dict
}
internal fun PrivateMessageHeader.output(contactId: ContactId, text: String?): JsonDict {
val dict = (this as ConversationMessageHeader).output(contactId, text)
dict.putAll(
"type" to "PrivateMessage"
)
return dict
}
internal fun PrivateMessageHeader.output(contactId: ContactId, text: String?) =
(this as ConversationMessageHeader).output(contactId, text).apply {
put("type", "PrivateMessage")
}
/**
* Use only for outgoing messages that were just sent