1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Merge branch 'master' into plugins

This commit is contained in:
James Booth 2016-07-24 15:44:16 +01:00
commit c6f1a87d1d
128 changed files with 457 additions and 421 deletions

View File

@ -1,11 +1,11 @@
core_sources = \
src/contact.c src/contact.h src/log.c src/common.c \
src/xmpp/contact.c src/xmpp/contact.h src/log.c src/common.c \
src/log.h src/profanity.c src/common.h \
src/profanity.h src/chat_session.c \
src/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \
src/chat_state.h src/chat_state.c \
src/resource.c src/resource.h \
src/roster_list.c src/roster_list.h \
src/profanity.h src/xmpp/chat_session.c \
src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \
src/xmpp/chat_state.h src/xmpp/chat_state.c \
src/xmpp/resource.c src/xmpp/resource.h \
src/xmpp/roster_list.c src/xmpp/roster_list.h \
src/xmpp/xmpp.h src/xmpp/capabilities.c src/xmpp/session.c \
src/xmpp/connection.h src/xmpp/connection.c \
src/xmpp/iq.c src/xmpp/message.c src/xmpp/presence.c src/xmpp/stanza.c \
@ -22,7 +22,7 @@ core_sources = \
src/ui/titlebar.h src/ui/statusbar.h src/ui/inputwin.h \
src/ui/console.c src/ui/notifier.c \
src/ui/win_types.h \
src/window_list.c src/window_list.h \
src/ui/window_list.c src/ui/window_list.h \
src/ui/rosterwin.c src/ui/occupantswin.c \
src/ui/buffer.c src/ui/buffer.h \
src/ui/chatwin.c \
@ -54,16 +54,16 @@ core_sources = \
src/plugins/themes.c src/plugins/themes.h \
src/plugins/settings.c src/plugins/settings.h \
src/plugins/disco.c src/plugins/disco.h \
src/tray.h src/tray.c
src/ui/tray.h src/ui/tray.c
unittest_sources = \
src/contact.c src/contact.h src/common.c \
src/xmpp/contact.c src/xmpp/contact.h src/common.c \
src/log.h src/profanity.c src/common.h \
src/profanity.h src/chat_session.c \
src/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \
src/resource.c src/resource.h \
src/chat_state.h src/chat_state.c \
src/roster_list.c src/roster_list.h \
src/profanity.h src/xmpp/chat_session.c \
src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \
src/xmpp/resource.c src/xmpp/resource.h \
src/xmpp/chat_state.h src/xmpp/chat_state.c \
src/xmpp/roster_list.c src/xmpp/roster_list.h \
src/xmpp/xmpp.h src/xmpp/form.c \
src/ui/ui.h \
src/otr/otr.h \
@ -90,10 +90,10 @@ unittest_sources = \
src/plugins/themes.c src/plugins/themes.h \
src/plugins/settings.c src/plugins/settings.h \
src/plugins/disco.c src/plugins/disco.h \
src/window_list.c src/window_list.h \
src/ui/window_list.c src/ui/window_list.h \
src/event/server_events.c src/event/server_events.h \
src/event/client_events.c src/event/client_events.h \
src/tray.h src/tray.c \
src/ui/tray.h src/ui/tray.c \
tests/unittests/xmpp/stub_xmpp.c \
tests/unittests/ui/stub_ui.c \
tests/unittests/log/stub_log.c \

View File

@ -41,17 +41,17 @@
#include <dirent.h>
#include "common.h"
#include "tools/parser.h"
#include "ui/win_types.h"
#include "command/cmd_funcs.h"
#include "config/preferences.h"
#include "config/scripts.h"
#include "muc.h"
#include "xmpp/xmpp.h"
#include "roster_list.h"
#include "window_list.h"
#include "plugins/plugins.h"
#include "command/cmd_ac.h"
#include "command/cmd_funcs.h"
#include "tools/parser.h"
#include "plugins/plugins.h"
#include "ui/win_types.h"
#include "ui/window_list.h"
#include "xmpp/muc.h"
#include "xmpp/xmpp.h"
#include "xmpp/roster_list.h"
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CMD_AC_H
#define CMD_AC_H
#ifndef COMMAND_CMD_AC_H
#define COMMAND_CMD_AC_H
#include "config/preferences.h"
#include "command/cmd_funcs.h"

View File

@ -48,29 +48,29 @@
#include <glib.h>
#include "chat_session.h"
#include "profanity.h"
#include "log.h"
#include "common.h"
#include "command/cmd_defs.h"
#include "command/cmd_funcs.h"
#include "command/cmd_ac.h"
#include "common.h"
#include "config/accounts.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "config/tlscerts.h"
#include "config/scripts.h"
#include "contact.h"
#include "roster_list.h"
#include "jid.h"
#include "log.h"
#include "muc.h"
#include "plugins/plugins.h"
#include "profanity.h"
#include "tools/autocomplete.h"
#include "tools/parser.h"
#include "tools/tinyurl.h"
#include "xmpp/xmpp.h"
#include "ui/ui.h"
#include "window_list.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/contact.h"
#include "xmpp/roster_list.h"
#include "xmpp/jid.h"
#include "xmpp/chat_session.h"
#include "xmpp/muc.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CMD_DEFS_H
#define CMD_DEFS_H
#ifndef COMMAND_CMD_DEFS_H
#define COMMAND_CMD_DEFS_H
#include <glib.h>

View File

@ -49,41 +49,45 @@
#include <langinfo.h>
#include <ctype.h>
#include "chat_session.h"
#include "profanity.h"
#include "log.h"
#include "common.h"
#include "command/cmd_funcs.h"
#include "command/cmd_defs.h"
#include "command/cmd_ac.h"
#include "common.h"
#include "config/accounts.h"
#include "config/account.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "config/tlscerts.h"
#include "config/scripts.h"
#include "contact.h"
#include "roster_list.h"
#include "jid.h"
#include "log.h"
#include "muc.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"
#endif
#include "profanity.h"
#include "plugins/plugins.h"
#include "event/client_events.h"
#include "tools/http_upload.h"
#include "tools/autocomplete.h"
#include "tools/parser.h"
#include "tools/tinyurl.h"
#include "xmpp/xmpp.h"
#include "plugins/plugins.h"
#include "ui/ui.h"
#include "window_list.h"
#include "event/client_events.h"
#ifdef HAVE_GTK
#include "tray.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/contact.h"
#include "xmpp/roster_list.h"
#include "xmpp/jid.h"
#include "xmpp/muc.h"
#include "xmpp/chat_session.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#include "tools/http_upload.h"
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"
#endif
#ifdef HAVE_GTK
#include "ui/tray.h"
#endif
#ifdef HAVE_PYTHON
#include "plugins/python_plugins.h"
#endif

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CMD_FUNCS_H
#define CMD_FUNCS_H
#ifndef COMMAND_CMD_FUNCS_H
#define COMMAND_CMD_FUNCS_H
#include "ui/win_types.h"

View File

@ -53,11 +53,9 @@
#include <ncurses.h>
#endif
#include "tools/p_sha1.h"
#include "log.h"
#include "common.h"
#include "tools/p_sha1.h"
struct curl_data_t
{

View File

@ -38,10 +38,10 @@
#include <glib.h>
#include "jid.h"
#include "config/account.h"
#include "common.h"
#include "log.h"
#include "config/account.h"
#include "xmpp/jid.h"
ProfAccount*
account_new(const gchar *const name, const gchar *const jid,

View File

@ -32,8 +32,8 @@
*
*/
#ifndef ACCOUNT_H
#define ACCOUNT_H
#ifndef CONFIG_ACCOUNT_H
#define CONFIG_ACCOUNT_H
#include "common.h"

View File

@ -41,12 +41,12 @@
#include "accounts.h"
#include "common.h"
#include "log.h"
#include "config/account.h"
#include "config/conflists.h"
#include "jid.h"
#include "log.h"
#include "tools/autocomplete.h"
#include "xmpp/xmpp.h"
#include "xmpp/jid.h"
static gchar *accounts_loc;
static GKeyFile *accounts;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef ACCOUNTS_H
#define ACCOUNTS_H
#ifndef CONFIG_ACCOUNTS_H
#define CONFIG_ACCOUNTS_H
#define MAX_PASSWORD_SIZE 64

View File

@ -32,9 +32,14 @@
*
*/
#ifndef CONFIG_CONFLISTS_H
#define CONFIG_CONFLISTS_H
#include <glib.h>
gboolean conf_string_list_add(GKeyFile *keyfile, const char *const group, const char *const key,
const char *const item);
gboolean conf_string_list_remove(GKeyFile *keyfile, const char *const group, const char *const key,
const char *const item);
#endif

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PREFERENCES_H
#define PREFERENCES_H
#ifndef CONFIG_PREFERENCES_H
#define CONFIG_PREFERENCES_H
#include "config.h"

View File

@ -42,9 +42,9 @@
#include "common.h"
#include "log.h"
#include "window_list.h"
#include "command/cmd_defs.h"
#include "ui/ui.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
void
@ -159,7 +159,7 @@ scripts_exec(const char *const script)
while ((read = getline(&line, &len, scriptfile)) != -1) {
ProfWin *win = wins_get_current();
cmd_process_input(win, line);
session_process_events(10);
session_process_events();
ui_update();
}

View File

@ -32,9 +32,14 @@
*
*/
#ifndef CONFIG_SCRIPTS_H
#define CONFIG_SCRIPTS_H
#include <glib.h>
void scripts_init(void);
GSList* scripts_list(void);
GSList* scripts_read(const char *const script);
gboolean scripts_exec(const char *const script);
#endif

View File

@ -38,6 +38,7 @@
#include <string.h>
#include <glib.h>
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H

View File

@ -32,8 +32,8 @@
*
*/
#ifndef THEME_H
#define THEME_H
#ifndef CONFIG_THEME_H
#define CONFIG_THEME_H
#include "config.h"

View File

@ -38,9 +38,9 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "config/tlscerts.h"
#include "log.h"
#include "common.h"
#include "config/tlscerts.h"
#include "tools/autocomplete.h"
static gchar *tlscerts_loc;

View File

@ -32,8 +32,10 @@
*
*/
#ifndef TLSCERTS_H
#define TLSCERTS_H
#ifndef CONFIG_TLSCERTS_H
#define CONFIG_TLSCERTS_H
#include <glib.h>
typedef struct tls_cert_t {
int version;

View File

@ -38,15 +38,17 @@
#include <glib.h>
#include "log.h"
#include "ui/ui.h"
#include "window_list.h"
#include "xmpp/xmpp.h"
#include "roster_list.h"
#include "chat_session.h"
#include "plugins/plugins.h"
#include "ui/window_list.h"
#include "ui/ui.h"
#include "xmpp/xmpp.h"
#include "xmpp/roster_list.h"
#include "xmpp/chat_session.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"
#endif

View File

@ -32,8 +32,10 @@
*
*/
#ifndef CLIENT_EVENTS_H
#define CLIENT_EVENTS_H
#ifndef EVENT_CLIENT_EVENTS_H
#define EVENT_CLIENT_EVENTS_H
#include "xmpp/xmpp.h"
jabber_conn_status_t cl_ev_connect_jid(const char *const jid, const char *const passwd, const char *const altdomain, const int port, const char *const tls_policy);
jabber_conn_status_t cl_ev_connect_account(ProfAccount *account);

View File

@ -38,22 +38,23 @@
#include <stdlib.h>
#include <assert.h>
#include "chat_session.h"
#include "profanity.h"
#include "log.h"
#include "muc.h"
#include "config/preferences.h"
#include "config/tlscerts.h"
#include "config/account.h"
#include "config/scripts.h"
#include "roster_list.h"
#include "plugins/plugins.h"
#include "window_list.h"
#include "config/tlscerts.h"
#include "profanity.h"
#include "event/client_events.h"
#include "plugins/plugins.h"
#include "ui/window_list.h"
#include "xmpp/muc.h"
#include "xmpp/chat_session.h"
#include "xmpp/roster_list.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"
#endif

View File

@ -32,8 +32,8 @@
*
*/
#ifndef SERVER_EVENTS_H
#define SERVER_EVENTS_H
#ifndef EVENT_SERVER_EVENTS_H
#define EVENT_SERVER_EVENTS_H
#include "xmpp/xmpp.h"

View File

@ -44,7 +44,6 @@
#include "glib/gstdio.h"
#include "log.h"
#include "common.h"
#include "config/preferences.h"
#include "xmpp/xmpp.h"

View File

@ -35,7 +35,7 @@
#ifndef LOG_H
#define LOG_H
#include "glib.h"
#include <glib.h>
// log levels
typedef enum {

View File

@ -38,16 +38,16 @@
#include <libotr/sm.h>
#include <glib.h>
#include "log.h"
#include "config/preferences.h"
#include "otr/otr.h"
#include "otr/otrlib.h"
#include "log.h"
#include "roster_list.h"
#include "window_list.h"
#include "contact.h"
#include "ui/ui.h"
#include "ui/window_list.h"
#include "xmpp/chat_session.h"
#include "xmpp/roster_list.h"
#include "xmpp/contact.h"
#include "xmpp/xmpp.h"
#include "config/preferences.h"
#include "chat_session.h"
#define PRESENCE_ONLINE 1
#define PRESENCE_OFFLINE 0

View File

@ -32,8 +32,8 @@
*
*/
#ifndef OTR_H
#define OTR_H
#ifndef OTR_OTR_H
#define OTR_OTR_H
#include <libotr/proto.h>
#include <libotr/message.h>

View File

@ -32,8 +32,8 @@
*
*/
#ifndef OTRLIB_H
#define OTRLIB_H
#ifndef OTR_OTRLIB_H
#define OTR_OTRLIB_H
OtrlPolicy otrlib_policy(void);

View File

@ -35,10 +35,10 @@
#include <libotr/privkey.h>
#include <libotr/message.h>
#include "ui/ui.h"
#include "window_list.h"
#include "otr/otr.h"
#include "otr/otrlib.h"
#include "ui/ui.h"
#include "ui/window_list.h"
OtrlPolicy
otrlib_policy(void)

View File

@ -36,11 +36,11 @@
#include <libotr/privkey.h>
#include <libotr/message.h>
#include "ui/ui.h"
#include "window_list.h"
#include "log.h"
#include "otr/otr.h"
#include "otr/otrlib.h"
#include "ui/ui.h"
#include "ui/window_list.h"
static GTimer *timer;
static unsigned int current_interval;

View File

@ -44,9 +44,9 @@
#include <glib/gstdio.h>
#include <gpgme.h>
#include "pgp/gpg.h"
#include "log.h"
#include "common.h"
#include "pgp/gpg.h"
#include "tools/autocomplete.h"
#include "ui/ui.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef GPG_H
#define GPG_H
#ifndef PGP_GPG_H
#define PGP_GPG_H
typedef struct pgp_key_t {
char *id;

View File

@ -38,7 +38,11 @@
#include <glib.h>
#include "profanity.h"
#include "log.h"
#include "common.h"
#include "config/theme.h"
#include "command/cmd_defs.h"
#include "event/server_events.h"
#include "event/client_events.h"
#include "plugins/callbacks.h"
@ -46,12 +50,8 @@
#include "plugins/themes.h"
#include "plugins/settings.h"
#include "plugins/disco.h"
#include "profanity.h"
#include "ui/ui.h"
#include "config/theme.h"
#include "command/cmd_defs.h"
#include "window_list.h"
#include "common.h"
#include "ui/window_list.h"
void
api_cons_alert(void)

View File

@ -32,8 +32,8 @@
*
*/
#ifndef API_H
#define API_H
#ifndef PLUGINS_API_H
#define PLUGINS_API_H
#include "plugins/callbacks.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef AUTOCOMPLETERS_H
#define AUTOCOMPLETERS_H
#ifndef PLUGINS_AUTOCOMPLETERS_H
#define PLUGINS_AUTOCOMPLETERS_H
#include <glib.h>

View File

@ -32,6 +32,9 @@
*
*/
#ifndef PLUGINS_C_API_H
#define PLUGINS_C_API_H
#include <glib.h>
void c_api_init(void);
@ -39,3 +42,5 @@ void c_api_init(void);
void c_command_callback(PluginCommand *command, gchar **args);
void c_timed_callback(PluginTimedFunction *timed_function);
void c_window_callback(PluginWindowCallback *window_callback, char *tag, char *line);
#endif

View File

@ -39,8 +39,8 @@
#include <glib.h>
#include "config/preferences.h"
#include "log.h"
#include "config/preferences.h"
#include "plugins/api.h"
#include "plugins/callbacks.h"
#include "plugins/plugins.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef C_PLUGINS_H
#define C_PLUGINS_H
#ifndef PLUGINS_C_PLUGINS_H
#define PLUGINS_C_PLUGINS_H
#include "plugins/plugins.h"

View File

@ -41,9 +41,8 @@
#include "plugins/plugins.h"
#include "tools/autocomplete.h"
#include "tools/parser.h"
#include "window_list.h"
#include "ui/ui.h"
#include "ui/window_list.h"
static GHashTable *p_commands = NULL;
static GHashTable *p_timed_functions = NULL;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CALLBACKS_H
#define CALLBACKS_H
#ifndef PLUGINS_CALLBACKS_H
#define PLUGINS_CALLBACKS_H
#include <glib.h>

View File

@ -32,8 +32,8 @@
*
*/
#ifndef DISCO_H
#define DISCO_H
#ifndef PLUGINS_DISCO_H
#define PLUGINS_DISCO_H
void disco_add_feature(char *feature);
GList* disco_get_features(void);

View File

@ -35,11 +35,10 @@
#include <string.h>
#include <stdlib.h>
#include "log.h"
#include "config.h"
#include "common.h"
#include "config/preferences.h"
#include "log.h"
#include "xmpp/xmpp.h"
#include "plugins/callbacks.h"
#include "plugins/autocompleters.h"
#include "plugins/api.h"
@ -47,6 +46,8 @@
#include "plugins/themes.h"
#include "plugins/settings.h"
#include "plugins/disco.h"
#include "ui/ui.h"
#include "xmpp/xmpp.h"
#ifdef HAVE_PYTHON
#include "plugins/python_plugins.h"
@ -68,8 +69,6 @@
#include "plugins/c_api.h"
#endif
#include "ui/ui.h"
static GHashTable *plugins;
void

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PLUGINS_H
#define PLUGINS_H
#ifndef PLUGINS_PLUGINS_H
#define PLUGINS_PLUGINS_H
#include "command/cmd_defs.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PROF_API_H
#define PROF_API_H
#ifndef PLUGINS_PROF_API_H
#define PLUGINS_PROF_API_H
#define prof_register_command(command_name, min_args, max_args, synopsis, description, arguments, examples, callback) _prof_register_command(__FILE__, command_name, min_args, max_args, synopsis, description, arguments, examples, callback)
#define prof_register_timed(callback, interval_seconds) _prof_register_timed(__FILE__, callback, interval_seconds)

View File

@ -41,12 +41,12 @@
#include <glib.h>
#include "log.h"
#include "plugins/api.h"
#include "plugins/python_api.h"
#include "plugins/python_plugins.h"
#include "plugins/callbacks.h"
#include "plugins/autocompleters.h"
#include "log.h"
static char* _python_plugin_name(void);

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PYTHON_API_H
#define PYTHON_API_H
#ifndef PLUGINS_PYTHON_API_H
#define PLUGINS_PYTHON_API_H
void python_env_init(void);
void python_init_prof(void);

View File

@ -35,7 +35,6 @@
#include <Python.h>
#include "config.h"
#include "config/preferences.h"
#include "plugins/api.h"
#include "plugins/callbacks.h"

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PYTHON_PLUGINS_H
#define PYTHON_PLUGINS_H
#ifndef PLUGINS_PYTHON_PLUGINS_H
#define PLUGINS_PYTHON_PLUGINS_H
#include "plugins/plugins.h"

View File

@ -38,8 +38,8 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "config/theme.h"
#include "common.h"
#include "config/theme.h"
static GKeyFile *settings;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PLUGIN_SETTINGS_H
#define PLUGIN_SETTINGS_H
#ifndef PLUGINS_SETTINGS_H
#define PLUGINS_SETTINGS_H
void plugin_settings_init(void);
void plugin_settings_close(void);

View File

@ -35,8 +35,8 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "config/theme.h"
#include "common.h"
#include "config/theme.h"
static GKeyFile *themes;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PLUGIN_THEMES_H
#define PLUGIN_THEMES_H
#ifndef PLUGINS_THEMES_H
#define PLUGINS_THEMES_H
void plugin_themes_init(void);
void plugin_themes_close(void);

View File

@ -38,43 +38,46 @@
#endif
#ifdef HAVE_GTK
#include "tray.h"
#include "ui/tray.h"
#endif
#include <locale.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <glib.h>
#include "profanity.h"
#include "chat_session.h"
#include "chat_state.h"
#include "common.h"
#include "log.h"
#include "config/tlscerts.h"
#include "config/accounts.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "config/tlscerts.h"
#include "config/scripts.h"
#include "command/cmd_defs.h"
#include "common.h"
#include "contact.h"
#include "roster_list.h"
#include "config/tlscerts.h"
#include "log.h"
#include "muc.h"
#include "plugins/plugins.h"
#include "event/client_events.h"
#include "ui/ui.h"
#include "ui/window_list.h"
#include "xmpp/resource.h"
#include "xmpp/xmpp.h"
#include "xmpp/muc.h"
#include "xmpp/chat_session.h"
#include "xmpp/chat_state.h"
#include "xmpp/contact.h"
#include "xmpp/roster_list.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#ifdef HAVE_LIBGPGME
#include "pgp/gpg.h"
#endif
#include "resource.h"
#include "xmpp/xmpp.h"
#include "ui/ui.h"
#include "window_list.h"
#include "event/client_events.h"
#include "config/tlscerts.h"
static void _check_autoaway(void);
static void _init(char *log_level);
@ -130,7 +133,7 @@ prof_run(char *log_level, char *account_name)
#endif
plugins_run_timed();
notify_remind();
session_process_events(10);
session_process_events();
iq_autoping_check();
ui_update();
#ifdef HAVE_GTK
@ -145,40 +148,6 @@ prof_set_quit(void)
force_quit = TRUE;
}
void
prof_handle_idle(void)
{
jabber_conn_status_t status = connection_get_status();
if (status == JABBER_CONNECTED) {
GSList *recipients = wins_get_chat_recipients();
GSList *curr = recipients;
while (curr) {
char *barejid = curr->data;
ProfChatWin *chatwin = wins_get_chat(barejid);
chat_state_handle_idle(chatwin->barejid, chatwin->state);
curr = g_slist_next(curr);
}
if (recipients) {
g_slist_free(recipients);
}
}
}
void
prof_handle_activity(void)
{
jabber_conn_status_t status = connection_get_status();
ProfWin *current = wins_get_current();
if ((status == JABBER_CONNECTED) && (current->type == WIN_CHAT)) {
ProfChatWin *chatwin = (ProfChatWin*)current;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
chat_state_handle_typing(chatwin->barejid, chatwin->state);
}
}
static void
_connect_default(const char *const account)
{

View File

@ -36,14 +36,10 @@
#define PROFANITY_H
#include <pthread.h>
#include "resource.h"
#include "xmpp/xmpp.h"
#include <glib.h>
void prof_run(char *log_level, char *account_name);
void prof_handle_idle(void);
void prof_handle_activity(void);
gboolean prof_process_input(char *inp);
void prof_set_quit(void);

View File

@ -32,8 +32,8 @@
*
*/
#ifndef AUTOCOMPLETE_H
#define AUTOCOMPLETE_H
#ifndef TOOLS_AUTOCOMPLETE_H
#define TOOLS_AUTOCOMPLETE_H
#include <glib.h>

View File

@ -45,11 +45,11 @@
#include <assert.h>
#include "profanity.h"
#include "event/client_events.h"
#include "tools/http_upload.h"
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/window.h"
#include "tools/http_upload.h"
#include "event/client_events.h"
#include "config/preferences.h"
#define FALLBACK_MIMETYPE "application/octet-stream"
#define FALLBACK_CONTENTTYPE_HEADER "Content-Type: application/octet-stream"

View File

@ -41,6 +41,7 @@
#include <sys/select.h>
#include <curl/curl.h>
#include "ui/win_types.h"
typedef struct http_upload_t {

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PARSER_H
#define PARSER_H
#ifndef TOOLS_PARSER_H
#define TOOLS_PARSER_H
#include <glib.h>

View File

@ -32,8 +32,8 @@
*
*/
#ifndef TINYURL_H
#define TINYURL_H
#ifndef TOOLS_TINYURL_H
#define TOOLS_TINYURL_H
#include <glib.h>

View File

@ -35,11 +35,11 @@
#ifndef UI_BUFFER_H
#define UI_BUFFER_H
#include <glib.h>
#include "config.h"
#include "config/theme.h"
#include <glib.h>
typedef struct delivery_receipt_t {
char *id;
gboolean received;

View File

@ -38,9 +38,9 @@
#include <stdlib.h>
#include <assert.h>
#include "chat_session.h"
#include "xmpp/chat_session.h"
#include "window_list.h"
#include "roster_list.h"
#include "xmpp/roster_list.h"
#include "log.h"
#include "config/preferences.h"
#include "ui/ui.h"

View File

@ -43,18 +43,18 @@
#include <ncurses.h>
#endif
#include "command/cmd_defs.h"
#include "common.h"
#include "log.h"
#include "muc.h"
#include "roster_list.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "ui/window.h"
#include "window_list.h"
#include "command/cmd_defs.h"
#include "ui/window_list.h"
#include "ui/ui.h"
#include "ui/window.h"
#include "ui/statusbar.h"
#include "xmpp/xmpp.h"
#include "xmpp/muc.h"
#include "xmpp/roster_list.h"
#ifdef HAVE_GIT_VERSION
#include "gitversion.h"

View File

@ -44,38 +44,40 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <glib.h>
#ifdef HAVE_LIBXSS
#include <X11/extensions/scrnsaver.h>
#endif
#include <glib.h>
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H
#include <ncurses.h>
#endif
#include "chat_session.h"
#include "log.h"
#include "common.h"
#include "command/cmd_defs.h"
#include "command/cmd_ac.h"
#include "common.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "contact.h"
#include "roster_list.h"
#include "jid.h"
#include "log.h"
#include "muc.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
#include "ui/ui.h"
#include "ui/titlebar.h"
#include "ui/statusbar.h"
#include "ui/inputwin.h"
#include "ui/window.h"
#include "window_list.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "plugins/plugins.h"
#include "xmpp/muc.h"
#include "xmpp/chat_session.h"
#include "xmpp/contact.h"
#include "xmpp/roster_list.h"
#include "xmpp/jid.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif
static char *win_title;
static int inp_size;

View File

@ -53,21 +53,22 @@
#include <ncurses.h>
#endif
#include "command/cmd_ac.h"
#include "profanity.h"
#include "log.h"
#include "common.h"
#include "command/cmd_ac.h"
#include "config/accounts.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "log.h"
#include "muc.h"
#include "profanity.h"
#include "roster_list.h"
#include "ui/ui.h"
#include "ui/statusbar.h"
#include "ui/inputwin.h"
#include "ui/window.h"
#include "window_list.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/muc.h"
#include "xmpp/roster_list.h"
#include "xmpp/chat_state.h"
static WINDOW *inp_win;
static int pad_start = 0;
@ -164,7 +165,7 @@ inp_readline(void)
rl_line_buffer[0] != '/' &&
rl_line_buffer[0] != '\0' &&
rl_line_buffer[0] != '\n') {
prof_handle_activity();
chat_state_activity();
}
ui_reset_idle_time();
@ -174,7 +175,7 @@ inp_readline(void)
inp_nonblocking(TRUE);
} else {
inp_nonblocking(FALSE);
prof_handle_idle();
chat_state_idle();
}
if (inp_line) {

View File

@ -38,7 +38,7 @@
#include "ui/ui.h"
#include "ui/window.h"
#include "ui/win_types.h"
#include "window_list.h"
#include "ui/window_list.h"
static void _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field);

View File

@ -38,12 +38,12 @@
#include <assert.h>
#include <stdlib.h>
#include "ui/win_types.h"
#include "window_list.h"
#include "log.h"
#include "config/preferences.h"
#include "ui/window.h"
#include "plugins/plugins.h"
#include "ui/window.h"
#include "ui/win_types.h"
#include "ui/window_list.h"
void
mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const actor, const char *const reason)

View File

@ -38,19 +38,21 @@
#include <stdlib.h>
#include <glib.h>
#ifdef HAVE_LIBNOTIFY
#include <libnotify/notify.h>
#endif
#ifdef PLATFORM_CYGWIN
#include <windows.h>
#endif
#include "log.h"
#include "muc.h"
#include "ui/ui.h"
#include "window_list.h"
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/muc.h"
static GTimer *remind_timer;

View File

@ -34,10 +34,10 @@
#include <assert.h>
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/window.h"
#include "window_list.h"
#include "config/preferences.h"
#include "ui/window_list.h"
static void
_occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean showjid)

View File

@ -36,12 +36,11 @@
#include <glib.h>
#include <stdlib.h>
#include "config/preferences.h"
#include "ui/win_types.h"
#include "ui/window.h"
#include "ui/titlebar.h"
#include "window_list.h"
#include "config/preferences.h"
#include "ui/window_list.h"
void
privwin_incoming_msg(ProfPrivateWin *privatewin, const char *const message, GDateTime *timestamp)

View File

@ -36,12 +36,12 @@
#include <stdlib.h>
#include <string.h>
#include "contact.h"
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/window.h"
#include "window_list.h"
#include "config/preferences.h"
#include "roster_list.h"
#include "ui/window_list.h"
#include "xmpp/roster_list.h"
#include "xmpp/contact.h"
typedef enum {
ROSTER_CONTACT,

View File

@ -45,10 +45,10 @@
#endif
#include "config/theme.h"
#include "config/preferences.h"
#include "ui/ui.h"
#include "ui/statusbar.h"
#include "ui/inputwin.h"
#include "config/preferences.h"
#define TIME_CHECK 60000000

View File

@ -44,10 +44,10 @@
#include "ui/ui.h"
#include "ui/titlebar.h"
#include "ui/inputwin.h"
#include "window_list.h"
#include "ui/window_list.h"
#include "ui/window.h"
#include "roster_list.h"
#include "chat_session.h"
#include "xmpp/roster_list.h"
#include "xmpp/chat_session.h"
static WINDOW *win;
static contact_presence_t current_presence;

View File

@ -39,10 +39,10 @@
#include <glib.h>
#include <glib/gstdio.h>
#include "tray.h"
#include "window_list.h"
#include "log.h"
#include "config/preferences.h"
#include "ui/tray.h"
#include "ui/window_list.h"
static gboolean gtk_ready = FALSE;
static GtkStatusIcon *prof_tray = NULL;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef PROFANITY_TRAY_H
#define PROFANITY_TRAY_H
#ifndef UI_TRAY_H
#define UI_TRAY_H
void tray_init(void);
void tray_update(void);

View File

@ -37,11 +37,12 @@
#include "config.h"
#include "command/cmd_funcs.h"
#include "ui/win_types.h"
#include "muc.h"
#include "config/tlscerts.h"
#include "config/account.h"
#include "command/cmd_funcs.h"
#include "ui/win_types.h"
#include "xmpp/muc.h"
#ifdef HAVE_LIBOTR
#include "otr/otr.h"
#endif

View File

@ -39,15 +39,16 @@
#include <wchar.h>
#include <glib.h>
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H
#include <ncurses.h>
#endif
#include "ui/buffer.h"
#include "chat_state.h"
#include "tools/autocomplete.h"
#include "ui/buffer.h"
#include "xmpp/chat_state.h"
#define LAYOUT_SPLIT_MEMCHECK 12345671
#define PROFCHATWIN_MEMCHECK 22374522

View File

@ -41,6 +41,7 @@
#include <wchar.h>
#include <glib.h>
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H
@ -49,10 +50,10 @@
#include "config/theme.h"
#include "config/preferences.h"
#include "roster_list.h"
#include "ui/ui.h"
#include "ui/window.h"
#include "xmpp/xmpp.h"
#include "xmpp/roster_list.h"
#define CONS_WIN_TITLE "Profanity. Type /help for help information."
#define XML_WIN_TITLE "XML Console"

View File

@ -39,19 +39,19 @@
#include <wchar.h>
#include "contact.h"
#include "muc.h"
#include "ui/ui.h"
#include "ui/buffer.h"
#include "xmpp/xmpp.h"
#include "chat_state.h"
#ifdef HAVE_NCURSESW_NCURSES_H
#include <ncursesw/ncurses.h>
#elif HAVE_NCURSES_H
#include <ncurses.h>
#endif
#include "ui/ui.h"
#include "ui/buffer.h"
#include "xmpp/xmpp.h"
#include "xmpp/chat_state.h"
#include "xmpp/contact.h"
#include "xmpp/muc.h"
#define PAD_SIZE 1000
void win_move_to_end(ProfWin *window);

View File

@ -41,14 +41,14 @@
#include <glib.h>
#include "common.h"
#include "roster_list.h"
#include "config/preferences.h"
#include "config/theme.h"
#include "plugins/plugins.h"
#include "ui/ui.h"
#include "ui/statusbar.h"
#include "window_list.h"
#include "plugins/plugins.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "config/preferences.h"
#include "xmpp/roster_list.h"
static GHashTable *windows;
static int current;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef WINDOW_LIST_H
#define WINDOW_LIST_H
#ifndef UI_WINDOW_LIST_H
#define UI_WINDOW_LIST_H
#include "ui/ui.h"

View File

@ -36,7 +36,7 @@
#include <string.h>
#include "ui/win_types.h"
#include "window_list.h"
#include "ui/window_list.h"
void
xmlwin_show(ProfXMLWin *xmlwin, const char *const msg)

View File

@ -38,6 +38,7 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif

View File

@ -43,21 +43,22 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"
#include "muc.h"
#include "event/server_events.h"
#include "plugins/plugins.h"
#include "ui/ui.h"
#include "xmpp/connection.h"
#include "xmpp/iq.h"
#include "xmpp/stanza.h"
#include "xmpp/xmpp.h"
#include "xmpp/bookmark.h"
#include "ui/ui.h"
#include "plugins/plugins.h"
#include "xmpp/muc.h"
#define BOOKMARK_TIMEOUT 5000

View File

@ -47,17 +47,18 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"
#include "plugins/plugins.h"
#include "xmpp/xmpp.h"
#include "xmpp/stanza.h"
#include "xmpp/form.h"
#include "xmpp/capabilities.h"
#include "plugins/plugins.h"
static gchar *cache_loc;
static GKeyFile *cache;

View File

@ -40,6 +40,7 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif

View File

@ -38,10 +38,10 @@
#include <glib.h>
#include "chat_session.h"
#include "config/preferences.h"
#include "log.h"
#include "config/preferences.h"
#include "xmpp/xmpp.h"
#include "xmpp/chat_session.h"
static GHashTable *sessions;

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CHAT_SESSION_H
#define CHAT_SESSION_H
#ifndef XMPP_CHAT_SESSION_H
#define XMPP_CHAT_SESSION_H
#include <glib.h>

View File

@ -33,13 +33,16 @@
*/
#include <stdlib.h>
#include <assert.h>
#include <glib.h>
#include "chat_state.h"
#include "chat_session.h"
#include "xmpp/xmpp.h"
#include "config/preferences.h"
#include "ui/window_list.h"
#include "ui/win_types.h"
#include "xmpp/xmpp.h"
#include "xmpp/chat_state.h"
#include "xmpp/chat_session.h"
#define PAUSED_TIMEOUT 10.0
#define INACTIVE_TIMEOUT 30.0
@ -149,6 +152,40 @@ chat_state_gone(const char *const barejid, ChatState *state)
}
}
void
chat_state_idle(void)
{
jabber_conn_status_t status = connection_get_status();
if (status == JABBER_CONNECTED) {
GSList *recipients = wins_get_chat_recipients();
GSList *curr = recipients;
while (curr) {
char *barejid = curr->data;
ProfChatWin *chatwin = wins_get_chat(barejid);
chat_state_handle_idle(chatwin->barejid, chatwin->state);
curr = g_slist_next(curr);
}
if (recipients) {
g_slist_free(recipients);
}
}
}
void
chat_state_activity(void)
{
jabber_conn_status_t status = connection_get_status();
ProfWin *current = wins_get_current();
if ((status == JABBER_CONNECTED) && (current->type == WIN_CHAT)) {
ProfChatWin *chatwin = (ProfChatWin*)current;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
chat_state_handle_typing(chatwin->barejid, chatwin->state);
}
}
static void
_send_if_supported(const char *const barejid, void (*send_func)(const char *const))
{

View File

@ -32,8 +32,8 @@
*
*/
#ifndef CHAT_STATE_H
#define CHAT_STATE_H
#ifndef XMPP_CHAT_STATE_H
#define XMPP_CHAT_STATE_H
#include <glib.h>
@ -53,6 +53,9 @@ typedef struct prof_chat_state_t {
ChatState* chat_state_new(void);
void chat_state_free(ChatState *state);
void chat_state_idle(void);
void chat_state_activity(void);
void chat_state_handle_idle(const char *const barejid, ChatState *state);
void chat_state_handle_typing(const char *const barejid, ChatState *state);
void chat_state_active(ChatState *state);

View File

@ -41,6 +41,7 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
@ -90,6 +91,12 @@ connection_init(void)
conn.available_resources = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)resource_destroy);
}
void
connection_check_events(void)
{
xmpp_run_once(conn.xmpp_ctx, 10);
}
void
connection_shutdown(void)
{
@ -191,7 +198,7 @@ connection_disconnect(void)
xmpp_disconnect(conn.xmpp_conn);
while (conn.conn_status == JABBER_DISCONNECTING) {
session_process_events(10);
session_process_events();
}
if (conn.xmpp_conn) {

View File

@ -39,6 +39,7 @@
void connection_init(void);
void connection_shutdown(void);
void connection_check_events(void);
jabber_conn_status_t connection_connect(const char *const fulljid, const char *const passwd, const char *const altdomain, int port,
const char *const tls_policy);

View File

@ -38,10 +38,10 @@
#include <glib.h>
#include "contact.h"
#include "common.h"
#include "resource.h"
#include "tools/autocomplete.h"
#include "xmpp/resource.h"
#include "xmpp/contact.h"
struct p_contact_t {
char *barejid;

View File

@ -32,11 +32,11 @@
*
*/
#ifndef CONTACT_H
#define CONTACT_H
#ifndef XMPP_CONTACT_H
#define XMPP_CONTACT_H
#include "resource.h"
#include "tools/autocomplete.h"
#include "xmpp/resource.h"
typedef struct p_contact_t *PContact;

View File

@ -40,6 +40,7 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif

View File

@ -32,18 +32,19 @@
*
*/
#ifndef FORM_H
#define FORM_H
#include "xmpp/xmpp.h"
#ifndef XMPP_FORM_H
#define XMPP_FORM_H
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "xmpp/xmpp.h"
DataForm* form_create(xmpp_stanza_t *const stanza);
xmpp_stanza_t* form_create_submission(DataForm *form);
char* form_get_form_type_field(DataForm *form);

View File

@ -46,30 +46,31 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "log.h"
#include "muc.h"
#include "profanity.h"
#include "ui/ui.h"
#include "window_list.h"
#include "log.h"
#include "config/preferences.h"
#include "event/server_events.h"
#include "plugins/plugins.h"
#include "tools/http_upload.h"
#include "ui/ui.h"
#include "ui/window_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/connection.h"
#include "xmpp/session.h"
#include "xmpp/iq.h"
#include "xmpp/capabilities.h"
#include "xmpp/blocking.h"
#include "xmpp/session.h"
#include "xmpp/stanza.h"
#include "xmpp/form.h"
#include "roster_list.h"
#include "xmpp/xmpp.h"
#include "xmpp/connection.h"
#include "xmpp/session.h"
#include "xmpp/iq.h"
#include "xmpp/roster_list.h"
#include "xmpp/roster.h"
#include "plugins/plugins.h"
#include "tools/http_upload.h"
#include "xmpp/muc.h"
typedef struct p_room_info_data_t {
char *room;

View File

@ -37,9 +37,8 @@
#include <glib.h>
#include "jid.h"
#include "common.h"
#include "xmpp/jid.h"
Jid*
jid_create(const gchar *const str)

View File

@ -32,8 +32,8 @@
*
*/
#ifndef JID_H
#define JID_H
#ifndef XMPP_JID_H
#define XMPP_JID_H
#include <glib.h>

View File

@ -40,26 +40,27 @@
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "chat_session.h"
#include "config/preferences.h"
#include "log.h"
#include "muc.h"
#include "profanity.h"
#include "ui/ui.h"
#include "log.h"
#include "config/preferences.h"
#include "event/server_events.h"
#include "pgp/gpg.h"
#include "plugins/plugins.h"
#include "ui/ui.h"
#include "xmpp/chat_session.h"
#include "xmpp/muc.h"
#include "xmpp/session.h"
#include "xmpp/message.h"
#include "xmpp/roster.h"
#include "roster_list.h"
#include "xmpp/roster_list.h"
#include "xmpp/stanza.h"
#include "xmpp/connection.h"
#include "xmpp/xmpp.h"
#include "pgp/gpg.h"
#include "plugins/plugins.h"
static int _message_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);

Some files were not shown because too many files have changed in this diff Show More