2
0
mirror of https://github.com/ars3niy/tdlib-purple synced 2025-08-31 14:05:10 +00:00

Prepare for sending read receipts only when conversation has focus

This commit is contained in:
Arseniy Lartsev
2021-01-01 14:14:16 +01:00
parent ee38a0c719
commit ec01fa2b5f
8 changed files with 86 additions and 3 deletions

View File

@@ -244,6 +244,18 @@ PurpleConvChat *findChatConversation(PurpleAccount *account, const td::td_api::c
return NULL;
}
bool conversationHasFocus(PurpleConversation *conv)
{
PurpleConversationUiOps *ops = purple_conversation_get_ui_ops(conv);
// purple_conversation_has_focus return false if this callback is not set, as is the case with
// bitlbee, but we want to default to sending read receipts
if ((ops == NULL) || (ops->has_focus == NULL))
return true;
else
return purple_conversation_has_focus(conv);
}
void updatePrivateChat(TdAccountData &account, const td::td_api::chat *chat, const td::td_api::user &user)
{
std::string purpleUserName = getPurpleBuddyName(user);