WIP - /statuses command options

This commit is contained in:
James Booth
2014-01-20 18:40:48 +00:00
parent 3f0addbc99
commit a7a2850637
13 changed files with 233 additions and 91 deletions

View File

@@ -23,6 +23,7 @@
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
@@ -86,6 +87,7 @@ prefs_close(void)
{
autocomplete_free(boolean_choice_ac);
g_key_file_free(prefs);
prefs = NULL;
}
char *

View File

@@ -315,11 +315,17 @@ handle_contact_online(char *barejid, Resource *resource,
{
gboolean updated = roster_update_presence(barejid, resource, last_activity);
if (updated && prefs_get_boolean(PREF_STATUSES)) {
if (updated) {
char *show_console = prefs_get_string(PREF_STATUSES_CONSOLE);
PContact contact = roster_get_contact(barejid);
if (p_contact_subscription(contact) != NULL) {
if (strcmp(p_contact_subscription(contact), "none") != 0) {
cons_show_contact_online(contact, resource, last_activity);
if (g_strcmp0(show_console, "all") == 0) {
cons_show_contact_online(contact, resource, last_activity);
} else if (g_strcmp0(show_console, "online") == 0 &&
resource->presence == RESOURCE_ONLINE) {
cons_show_contact_online(contact, resource, last_activity);
}
ui_chat_win_contact_online(contact, resource, last_activity);
}
}

View File

@@ -23,6 +23,8 @@
#ifndef SERVER_EVENTS_H
#define SERVER_EVENTS_H
#include "xmpp/xmpp.h"
void handle_error_message(const char *from, const char *err_msg);
void handle_login_account_success(char *account_name);
void handle_lost_connection(void);