mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Added cl_ev_presence_send
This commit is contained in:
parent
56cbce2ff3
commit
d853284f92
@ -507,7 +507,7 @@ cmd_account(gchar **args, struct cmd_help_t help)
|
||||
|
||||
if (presence_type == last_presence) {
|
||||
char *message = jabber_get_presence_message();
|
||||
presence_send(last_presence, message, 0);
|
||||
cl_ev_presence_send(last_presence, message, 0);
|
||||
}
|
||||
}
|
||||
cons_show("Updated %s priority for account %s: %s", property, account_name, value);
|
||||
@ -3808,7 +3808,7 @@ cmd_priority(gchar **args, struct cmd_help_t help)
|
||||
if (res) {
|
||||
accounts_set_priority_all(jabber_get_account_name(), intval);
|
||||
resource_presence_t last_presence = accounts_get_last_presence(jabber_get_account_name());
|
||||
presence_send(last_presence, jabber_get_presence_message(), 0);
|
||||
cl_ev_presence_send(last_presence, jabber_get_presence_message(), 0);
|
||||
cons_show("Priority set to %d.", intval);
|
||||
} else {
|
||||
cons_show(err_msg);
|
||||
@ -4330,7 +4330,7 @@ _update_presence(const resource_presence_t resource_presence,
|
||||
if (conn_status != JABBER_CONNECTED) {
|
||||
cons_show("You are not currently connected.");
|
||||
} else {
|
||||
presence_send(resource_presence, msg, 0);
|
||||
cl_ev_presence_send(resource_presence, msg, 0);
|
||||
ui_update_presence(resource_presence, msg, show);
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,12 @@ cl_ev_connect_account(ProfAccount *account)
|
||||
return jabber_connect_with_account(account);
|
||||
}
|
||||
|
||||
void
|
||||
cl_ev_presence_send(const resource_presence_t presence_type, const char * const msg, const int idle)
|
||||
{
|
||||
presence_send(presence_type, msg, idle);
|
||||
}
|
||||
|
||||
void
|
||||
cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg)
|
||||
{
|
||||
|
@ -38,6 +38,8 @@
|
||||
jabber_conn_status_t cl_ev_connect_jid(const char * const jid, const char * const passwd, const char * const altdomain, const int port);
|
||||
jabber_conn_status_t cl_ev_connect_account(ProfAccount *account);
|
||||
|
||||
void cl_ev_presence_send(const resource_presence_t presence_type, const char * const msg, const int idle);
|
||||
|
||||
void cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg);
|
||||
void cl_ev_send_muc_msg(ProfMucWin *mucwin, const char * const msg);
|
||||
void cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char * const msg);
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include "xmpp/xmpp.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/windows.h"
|
||||
#include "event/client_events.h"
|
||||
|
||||
static void _check_autoaway(void);
|
||||
static void _init(const int disable_tls, char *log_level);
|
||||
@ -172,12 +173,12 @@ _check_autoaway()
|
||||
|
||||
// handle away mode
|
||||
if (strcmp(pref_autoaway_mode, "away") == 0) {
|
||||
presence_send(RESOURCE_AWAY, pref_autoaway_message, 0);
|
||||
cl_ev_presence_send(RESOURCE_AWAY, pref_autoaway_message, 0);
|
||||
ui_auto_away();
|
||||
|
||||
// handle idle mode
|
||||
} else if (strcmp(pref_autoaway_mode, "idle") == 0) {
|
||||
presence_send(RESOURCE_ONLINE, pref_autoaway_message, idle_ms / 1000);
|
||||
cl_ev_presence_send(RESOURCE_ONLINE, pref_autoaway_message, idle_ms / 1000);
|
||||
}
|
||||
|
||||
prefs_free_string(pref_autoaway_message);
|
||||
@ -191,10 +192,10 @@ _check_autoaway()
|
||||
// handle check
|
||||
if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) {
|
||||
if (strcmp(pref_autoaway_mode, "away") == 0) {
|
||||
presence_send(RESOURCE_ONLINE, NULL, 0);
|
||||
cl_ev_presence_send(RESOURCE_ONLINE, NULL, 0);
|
||||
ui_end_auto_away();
|
||||
} else if (strcmp(pref_autoaway_mode, "idle") == 0) {
|
||||
presence_send(RESOURCE_ONLINE, NULL, 0);
|
||||
cl_ev_presence_send(RESOURCE_ONLINE, NULL, 0);
|
||||
ui_titlebar_presence(CONTACT_ONLINE);
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "profanity.h"
|
||||
#include "ui/ui.h"
|
||||
#include "event/server_events.h"
|
||||
#include "event/client_events.h"
|
||||
#include "tools/autocomplete.h"
|
||||
#include "xmpp/connection.h"
|
||||
#include "xmpp/roster.h"
|
||||
@ -331,7 +332,7 @@ _roster_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, v
|
||||
sv_ev_roster_received();
|
||||
|
||||
resource_presence_t conn_presence = accounts_get_login_presence(jabber_get_account_name());
|
||||
presence_send(conn_presence, NULL, 0);
|
||||
cl_ev_presence_send(conn_presence, NULL, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user