mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 05:46:21 +00:00
Fixed chat state for non OTR
This commit is contained in:
@@ -82,7 +82,7 @@ chat_sessions_clear(void)
|
||||
}
|
||||
|
||||
void
|
||||
chat_session_start(const char * const recipient, gboolean recipient_supports)
|
||||
chat_session_new(const char * const recipient, gboolean recipient_supports)
|
||||
{
|
||||
ChatSession *new_session = malloc(sizeof(struct chat_session_t));
|
||||
new_session->recipient = strdup(recipient);
|
||||
@@ -260,6 +260,23 @@ chat_session_set_recipient_supports(const char * const recipient,
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
chat_session_on_message_send(const char * const barejid)
|
||||
{
|
||||
gboolean send_state = FALSE;
|
||||
if (prefs_get_boolean(PREF_STATES)) {
|
||||
if (!chat_session_exists(barejid)) {
|
||||
chat_session_new(barejid, TRUE);
|
||||
}
|
||||
if (chat_session_get_recipient_supports(barejid)) {
|
||||
chat_session_set_active(barejid);
|
||||
send_state = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return send_state;
|
||||
}
|
||||
|
||||
static void
|
||||
_chat_session_free(ChatSession *session)
|
||||
{
|
||||
@@ -271,4 +288,4 @@ _chat_session_free(ChatSession *session)
|
||||
}
|
||||
free(session);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user