mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Removed presence from jabber_conn
This commit is contained in:
parent
4cb77272f3
commit
59e9b10d19
@ -1198,8 +1198,9 @@ _cmd_account(gchar **args, struct cmd_help_t help)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
if (conn_status == JABBER_CONNECTED && presence_type == jabber_get_presence_type()) {
|
presence_t last_presence = accounts_get_last_presence(jabber_get_account_name());
|
||||||
presence_update(jabber_get_presence_type(), jabber_get_presence_message(), 0);
|
if (conn_status == JABBER_CONNECTED && presence_type == last_presence) {
|
||||||
|
presence_update(last_presence, jabber_get_presence_message(), 0);
|
||||||
}
|
}
|
||||||
cons_show("Updated %s priority for account %s: %s", property, account_name, value);
|
cons_show("Updated %s priority for account %s: %s", property, account_name, value);
|
||||||
cons_show("");
|
cons_show("");
|
||||||
@ -2238,9 +2239,8 @@ _cmd_set_priority(gchar **args, struct cmd_help_t help)
|
|||||||
|
|
||||||
if (_strtoi(value, &intval, -128, 127) == 0) {
|
if (_strtoi(value, &intval, -128, 127) == 0) {
|
||||||
accounts_set_priority_all(jabber_get_account_name(), intval);
|
accounts_set_priority_all(jabber_get_account_name(), intval);
|
||||||
//prefs_set_priority((int)intval);
|
presence_t last_presence = accounts_get_last_presence(jabber_get_account_name());
|
||||||
// update presence with new priority
|
presence_update(last_presence, jabber_get_presence_message(), 0);
|
||||||
presence_update(jabber_get_presence_type(), jabber_get_presence_message(), 0);
|
|
||||||
cons_show("Priority set to %d.", intval);
|
cons_show("Priority set to %d.", intval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ static struct _jabber_conn_t {
|
|||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
xmpp_conn_t *conn;
|
xmpp_conn_t *conn;
|
||||||
jabber_conn_status_t conn_status;
|
jabber_conn_status_t conn_status;
|
||||||
presence_t presence_type;
|
|
||||||
char *presence_message;
|
char *presence_message;
|
||||||
int priority;
|
int priority;
|
||||||
int tls_disabled;
|
int tls_disabled;
|
||||||
@ -89,7 +88,6 @@ jabber_init(const int disable_tls)
|
|||||||
{
|
{
|
||||||
log_info("Initialising XMPP");
|
log_info("Initialising XMPP");
|
||||||
jabber_conn.conn_status = JABBER_STARTED;
|
jabber_conn.conn_status = JABBER_STARTED;
|
||||||
jabber_conn.presence_type = PRESENCE_OFFLINE;
|
|
||||||
jabber_conn.presence_message = NULL;
|
jabber_conn.presence_message = NULL;
|
||||||
jabber_conn.tls_disabled = disable_tls;
|
jabber_conn.tls_disabled = disable_tls;
|
||||||
presence_init();
|
presence_init();
|
||||||
@ -165,7 +163,6 @@ jabber_disconnect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
jabber_conn.conn_status = JABBER_STARTED;
|
jabber_conn.conn_status = JABBER_STARTED;
|
||||||
jabber_conn.presence_type = PRESENCE_OFFLINE;
|
|
||||||
FREE_SET_NULL(jabber_conn.presence_message);
|
FREE_SET_NULL(jabber_conn.presence_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,12 +225,6 @@ jabber_get_jid(void)
|
|||||||
return xmpp_conn_get_jid(jabber_conn.conn);
|
return xmpp_conn_get_jid(jabber_conn.conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
presence_t
|
|
||||||
jabber_get_presence_type(void)
|
|
||||||
{
|
|
||||||
return jabber_conn.presence_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
jabber_get_presence_message(void)
|
jabber_get_presence_message(void)
|
||||||
{
|
{
|
||||||
@ -246,12 +237,6 @@ jabber_get_account_name(void)
|
|||||||
return saved_account.name;
|
return saved_account.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
connection_set_presence_type(const presence_t presence_type)
|
|
||||||
{
|
|
||||||
jabber_conn.presence_type = presence_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
connection_set_presence_message(const char * const message)
|
connection_set_presence_message(const char * const message)
|
||||||
{
|
{
|
||||||
@ -424,7 +409,6 @@ _connection_handler(xmpp_conn_t * const conn,
|
|||||||
|
|
||||||
iq_roster_request();
|
iq_roster_request();
|
||||||
jabber_conn.conn_status = JABBER_CONNECTED;
|
jabber_conn.conn_status = JABBER_CONNECTED;
|
||||||
jabber_conn.presence_type = PRESENCE_ONLINE;
|
|
||||||
|
|
||||||
if (prefs_get_reconnect() != 0) {
|
if (prefs_get_reconnect() != 0) {
|
||||||
if (reconnect_timer != NULL) {
|
if (reconnect_timer != NULL) {
|
||||||
@ -461,7 +445,6 @@ _connection_handler(xmpp_conn_t * const conn,
|
|||||||
|
|
||||||
// close stream response from server after disconnect is handled too
|
// close stream response from server after disconnect is handled too
|
||||||
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
jabber_conn.conn_status = JABBER_DISCONNECTED;
|
||||||
jabber_conn.presence_type = PRESENCE_OFFLINE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,6 @@ presence_update(presence_t presence_type, const char * const msg,
|
|||||||
if (jabber_get_connection_status() != JABBER_CONNECTED)
|
if (jabber_get_connection_status() != JABBER_CONNECTED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
connection_set_presence_type(presence_type);
|
|
||||||
connection_set_presence_message(msg);
|
connection_set_presence_message(msg);
|
||||||
connection_set_priority(pri);
|
connection_set_priority(pri);
|
||||||
|
|
||||||
@ -161,7 +160,7 @@ presence_join_room(Jid *jid)
|
|||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx = connection_get_ctx();
|
xmpp_ctx_t *ctx = connection_get_ctx();
|
||||||
xmpp_conn_t *conn = connection_get_conn();
|
xmpp_conn_t *conn = connection_get_conn();
|
||||||
presence_t presence_type = jabber_get_presence_type();
|
presence_t presence_type = accounts_get_last_presence(jabber_get_account_name());
|
||||||
const char *show = stanza_get_presence_string_from_type(presence_type);
|
const char *show = stanza_get_presence_string_from_type(presence_type);
|
||||||
char *status = jabber_get_presence_message();
|
char *status = jabber_get_presence_message();
|
||||||
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
||||||
@ -184,7 +183,7 @@ presence_change_room_nick(const char * const room, const char * const nick)
|
|||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx = connection_get_ctx();
|
xmpp_ctx_t *ctx = connection_get_ctx();
|
||||||
xmpp_conn_t *conn = connection_get_conn();
|
xmpp_conn_t *conn = connection_get_conn();
|
||||||
presence_t presence_type = jabber_get_presence_type();
|
presence_t presence_type = accounts_get_last_presence(jabber_get_account_name());
|
||||||
const char *show = stanza_get_presence_string_from_type(presence_type);
|
const char *show = stanza_get_presence_string_from_type(presence_type);
|
||||||
char *status = jabber_get_presence_message();
|
char *status = jabber_get_presence_message();
|
||||||
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
||||||
|
@ -66,7 +66,6 @@ void jabber_disconnect(void);
|
|||||||
void jabber_process_events(void);
|
void jabber_process_events(void);
|
||||||
const char * jabber_get_jid(void);
|
const char * jabber_get_jid(void);
|
||||||
jabber_conn_status_t jabber_get_connection_status(void);
|
jabber_conn_status_t jabber_get_connection_status(void);
|
||||||
presence_t jabber_get_presence_type(void);
|
|
||||||
char * jabber_get_presence_message(void);
|
char * jabber_get_presence_message(void);
|
||||||
void jabber_set_autoping(int seconds);
|
void jabber_set_autoping(int seconds);
|
||||||
char* jabber_get_account_name(void);
|
char* jabber_get_account_name(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user