(purple) Handle outgoing invites

Fixes #23
This commit is contained in:
Jaidyn Ann 2021-07-01 20:18:10 -05:00
parent 10003276cd
commit d63fe22afe

View File

@ -222,6 +222,23 @@ PurpleApp::ImMessage(BMessage* msg)
SendMessage(_AccountFromMessage(msg), roster); SendMessage(_AccountFromMessage(msg), roster);
break; break;
} }
case IM_ROOM_SEND_INVITE:
{
PurpleAccount* account = _AccountFromMessage(msg);
PurpleConversation* conv = _ConversationFromMessage(msg);
PurpleConvChat* chat = purple_conversation_get_chat_data(conv);
BString user_id = msg->FindString("user");
BString body = msg->FindString("body");
if (chat == NULL || user_id.IsEmpty() == true)
break;
if (body.IsEmpty() == true)
body = "(Invite)";
purple_conv_chat_invite_user(chat, user_id.String(), body.String(),
false);
break;
}
case IM_ROOM_INVITE_ACCEPT: case IM_ROOM_INVITE_ACCEPT:
{ {
PurpleAccount* account = _AccountFromMessage(msg); PurpleAccount* account = _AccountFromMessage(msg);