1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Added chat_session_on_incoming_message

This commit is contained in:
James Booth 2014-12-29 00:16:40 +00:00
parent 671ee0b876
commit fe2ef44cac
3 changed files with 12 additions and 5 deletions

View File

@ -277,6 +277,16 @@ chat_session_on_message_send(const char * const barejid)
return send_state;
}
void
chat_session_on_incoming_message(const char * const barejid, gboolean recipient_supports)
{
if (!chat_session_exists(barejid)) {
chat_session_new(barejid, recipient_supports);
} else {
chat_session_set_recipient_supports(barejid, recipient_supports);
}
}
void
chat_session_on_window_open(const char * const barejid)
{

View File

@ -58,5 +58,6 @@ void chat_session_set_sent(const char * const recipient);
gboolean chat_session_get_sent(const char * const recipient);
gboolean chat_session_on_message_send(const char * const barejid);
void chat_session_on_window_open(const char * const barejid);
void chat_session_on_incoming_message(const char * const barejid, gboolean recipient_supports);
#endif

View File

@ -459,11 +459,7 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
// create or update chat session
if (!chat_session_exists(jid->barejid)) {
chat_session_new(jid->barejid, recipient_supports);
} else {
chat_session_set_recipient_supports(jid->barejid, recipient_supports);
}
chat_session_on_incoming_message(jid->barejid, recipient_supports);
// determine if the notifications happened whilst offline
GTimeVal tv_stamp;