Display warning when opening a chat the current user is no longer a member of

This commit is contained in:
mjentsch 2015-03-20 17:47:05 +01:00
parent 0664c5b2fe
commit 293c6049a6

View file

@ -50,6 +50,10 @@ PurpleConversation *chat_show (PurpleConnection *gc, int id) {
}
convo = p2tgl_got_joined_chat (conn->TLS, &P->chat);
chat_users_update (conn->TLS, &P->chat);
if (PURPLE_CONNECTION_IS_CONNECTED(gc) && ! chat_is_member(conn->TLS->our_id, &P->chat)) {
p2tgl_conversation_write (convo, TGL_MK_CHAT(id), "You are no longer a member of this chat.",
PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, (int)time (NULL));
}
}
return convo;