mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 22:36:22 +00:00
Send <gone/> when closing chat window
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "chat_session.h"
|
||||
#include "command.h"
|
||||
#include "common.h"
|
||||
#include "contact.h"
|
||||
@@ -985,8 +986,21 @@ _cmd_tiny(const char * const inp, struct cmd_help_t help)
|
||||
static gboolean
|
||||
_cmd_close(const char * const inp, struct cmd_help_t help)
|
||||
{
|
||||
if (!win_close_win())
|
||||
if (win_in_chat()) {
|
||||
char *recipient = win_get_recipient();
|
||||
|
||||
// send <gone/> chat state before closing
|
||||
if (chat_session_get_recipient_supports(recipient)) {
|
||||
chat_session_gone(recipient);
|
||||
jabber_send_gone(recipient);
|
||||
chat_session_end(recipient);
|
||||
}
|
||||
|
||||
win_close_win();
|
||||
|
||||
} else {
|
||||
cons_bad_command(inp);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user