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

Merge branch 'master' into openpgp

This commit is contained in:
James Booth 2015-05-07 23:23:45 +01:00
commit 0db7bcbdcd
5 changed files with 18 additions and 8 deletions

View File

@ -514,7 +514,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);
@ -3819,7 +3819,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);
@ -4396,7 +4396,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);
}
}

View File

@ -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)
{

View File

@ -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);

View File

@ -66,6 +66,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);
@ -175,12 +176,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);
@ -194,10 +195,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);
}
}

View File

@ -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;
}