(purple) Senderless messages are system messages

This commit is contained in:
Jaidyn Ann 2021-07-06 14:27:14 -05:00
parent 735dda4188
commit f0f2375b09

View File

@ -1057,12 +1057,15 @@ signal_received_chat_msg(PurpleAccount* account, char* sender, char* message,
if (chat_id.IsEmpty() == true) if (chat_id.IsEmpty() == true)
chat_id = sender; chat_id = sender;
BMessage chat(IM_MESSAGE); PurpleConvChat* chat = purple_conversation_get_chat_data(conv);
chat.AddInt32("im_what", IM_MESSAGE_RECEIVED);
chat.AddString("chat_id", chat_id); BMessage msg(IM_MESSAGE);
chat.AddString("user_id", sender); msg.AddInt32("im_what", IM_MESSAGE_RECEIVED);
chat.AddString("body", purple_unescape_text(message)); msg.AddString("chat_id", chat_id);
((PurpleApp*)be_app)->SendMessage(account, chat); if (chat == NULL || purple_conv_chat_find_user(chat, sender) == true)
msg.AddString("user_id", sender);
msg.AddString("body", purple_unescape_text(message));
((PurpleApp*)be_app)->SendMessage(account, msg);
} }