mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 09:16:22 +00:00
Do not send presence when in groupchat
This commit is contained in:
@@ -149,7 +149,7 @@ inp_get_char(int *ch, char *input, int *size)
|
|||||||
// if not got char, and in chat window, flag as no activity
|
// if not got char, and in chat window, flag as no activity
|
||||||
// send inactive or gone, depending how long inactive
|
// send inactive or gone, depending how long inactive
|
||||||
if (*ch == ERR) {
|
if (*ch == ERR) {
|
||||||
if (win_in_chat()) {
|
if (win_in_chat() && !win_in_groupchat()) {
|
||||||
char *recipient = win_get_recipient();
|
char *recipient = win_get_recipient();
|
||||||
chat_session_no_activity(recipient);
|
chat_session_no_activity(recipient);
|
||||||
|
|
||||||
@@ -168,8 +168,8 @@ inp_get_char(int *ch, char *input, int *size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if got char and in chat window, chat session active
|
// if got char and in chat window, chat session active
|
||||||
if (prefs_get_outtype() && (*ch != ERR) && win_in_chat() && !in_command &&
|
if (prefs_get_outtype() && (*ch != ERR) && win_in_chat() &&
|
||||||
_printable(*ch)) {
|
!win_in_groupchat() && !in_command && _printable(*ch)) {
|
||||||
char *recipient = win_get_recipient();
|
char *recipient = win_get_recipient();
|
||||||
chat_session_set_composing(recipient);
|
chat_session_set_composing(recipient);
|
||||||
if (!chat_session_get_sent(recipient) ||
|
if (!chat_session_get_sent(recipient) ||
|
||||||
|
|||||||
@@ -401,6 +401,9 @@ _message_handler(xmpp_conn_t * const conn,
|
|||||||
from = xmpp_stanza_get_attribute(stanza, "from");
|
from = xmpp_stanza_get_attribute(stanza, "from");
|
||||||
|
|
||||||
if (room_jid_is_room_chat(from)) {
|
if (room_jid_is_room_chat(from)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cons_show("CHAT ROOM MESSAGE RECIEVED");
|
cons_show("CHAT ROOM MESSAGE RECIEVED");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
1
src/ui.h
1
src/ui.h
@@ -106,6 +106,7 @@ void win_remind(void);
|
|||||||
void win_join_chat(const char * const room_jid, const char * const nick);
|
void win_join_chat(const char * const room_jid, const char * const nick);
|
||||||
void win_show_chat_room_member(const char * const room_jid,
|
void win_show_chat_room_member(const char * const room_jid,
|
||||||
const char * const nick);
|
const char * const nick);
|
||||||
|
int win_in_groupchat(void);
|
||||||
|
|
||||||
// console window actions
|
// console window actions
|
||||||
void cons_about(void);
|
void cons_about(void);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "release.h"
|
#include "release.h"
|
||||||
|
#include "room_chat.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
#define CONS_WIN_TITLE "_cons"
|
#define CONS_WIN_TITLE "_cons"
|
||||||
@@ -196,6 +197,16 @@ win_in_chat(void)
|
|||||||
(strcmp(_wins[_curr_prof_win].from, "") != 0));
|
(strcmp(_wins[_curr_prof_win].from, "") != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
win_in_groupchat(void)
|
||||||
|
{
|
||||||
|
if (room_jid_is_room_chat(_wins[_curr_prof_win].from)) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
win_get_recipient(void)
|
win_get_recipient(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user