mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-13 09:10:20 +00:00
Some remaining fixes
This commit is contained in:
@@ -40,7 +40,7 @@ write_error (char *message,
|
||||
}
|
||||
|
||||
void
|
||||
xchat_remote (void)
|
||||
hexchat_remote (void)
|
||||
/* TODO: dbus_g_connection_unref (connection) are commented because it makes
|
||||
* dbus to crash. Fixed in dbus >=0.70 ?!?
|
||||
* https://launchpad.net/distros/ubuntu/+source/dbus/+bug/54375
|
||||
@@ -49,7 +49,7 @@ xchat_remote (void)
|
||||
DBusGConnection *connection;
|
||||
DBusGProxy *dbus = NULL;
|
||||
DBusGProxy *remote_object = NULL;
|
||||
gboolean xchat_running;
|
||||
gboolean hexchat_running;
|
||||
GError *error = NULL;
|
||||
char *command = NULL;
|
||||
|
||||
@@ -73,7 +73,7 @@ xchat_remote (void)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Checks if xchat is already running */
|
||||
/* Checks if HexChat is already running */
|
||||
dbus = dbus_g_proxy_new_for_name (connection,
|
||||
DBUS_SERVICE_DBUS,
|
||||
DBUS_PATH_DBUS,
|
||||
@@ -81,14 +81,14 @@ xchat_remote (void)
|
||||
if (!dbus_g_proxy_call (dbus, "NameHasOwner", &error,
|
||||
G_TYPE_STRING, DBUS_SERVICE,
|
||||
G_TYPE_INVALID,
|
||||
G_TYPE_BOOLEAN, &xchat_running,
|
||||
G_TYPE_BOOLEAN, &hexchat_running,
|
||||
G_TYPE_INVALID)) {
|
||||
write_error (_("Failed to complete NameHasOwner"), &error);
|
||||
xchat_running = FALSE;
|
||||
hexchat_running = FALSE;
|
||||
}
|
||||
g_object_unref (dbus);
|
||||
|
||||
if (!xchat_running) {
|
||||
if (!hexchat_running) {
|
||||
//dbus_g_connection_unref (connection);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
#ifndef __DBUS_PLUGIN_H__
|
||||
#define __DBUS_PLUGIN_H__
|
||||
|
||||
void xchat_remote (void);
|
||||
void hexchat_remote (void);
|
||||
|
||||
#endif /* __DBUS_PLUGIN_H__ */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* dbus-plugin.c - xchat plugin for remote access using D-Bus
|
||||
/* dbus-plugin.c - hexchat plugin for remote access using D-Bus
|
||||
* Copyright (C) 2006 Claessens Xavier
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -510,7 +510,7 @@ remote_object_get_prefs (RemoteObject *obj,
|
||||
*ret_type = 0;
|
||||
return TRUE;
|
||||
}
|
||||
*ret_type = xchat_get_prefs (ph, name, &str, ret_int);
|
||||
*ret_type = hexchat_get_prefs (ph, name, &str, ret_int);
|
||||
*ret_str = g_strdup (str);
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* dbus-plugin.c - xchat plugin for remote access using DBUS
|
||||
/* dbus-plugin.c - hexchat plugin for remote access using DBUS
|
||||
* Copyright (C) 2006 Claessens Xavier
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef XCHAT_DBUS_PLUGIN_H
|
||||
#define XCHAT_DBUS_PLUGIN_H
|
||||
|
||||
int dbus_plugin_init (xchat_plugin *plugin_handle,
|
||||
int dbus_plugin_init (hexchat_plugin *plugin_handle,
|
||||
char **plugin_name,
|
||||
char **plugin_desc,
|
||||
char **plugin_version,
|
||||
|
||||
@@ -73,7 +73,7 @@ test_command_cb (DBusGProxy *proxy,
|
||||
G_TYPE_INVALID, G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete unhook", &error);
|
||||
}
|
||||
/* Now if you write "/test blah" again in the xchat window
|
||||
/* Now if you write "/test blah" again in the HexChat window
|
||||
* you'll get a "Unknown command" error message */
|
||||
g_print ("test command received: %s\n", word_eol[1]);
|
||||
if (!dbus_g_proxy_call (proxy, "Print",
|
||||
@@ -193,7 +193,7 @@ main (int argc, char **argv)
|
||||
G_CALLBACK (unload_cb),
|
||||
NULL, NULL);
|
||||
|
||||
/* Now you can write on the xchat windows: "/test arg1 arg2 ..." */
|
||||
/* Now you can write on the HexChat windows: "/test arg1 arg2 ..." */
|
||||
mainloop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (mainloop);
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ struct _hexchat_plugin
|
||||
hexchat_context *(*hexchat_get_context) (hexchat_plugin *ph);
|
||||
const char *(*hexchat_get_info) (hexchat_plugin *ph,
|
||||
const char *id);
|
||||
int (*xchat_get_prefs) (hexchat_plugin *ph,
|
||||
int (*hexchat_get_prefs) (hexchat_plugin *ph,
|
||||
const char *name,
|
||||
const char **string,
|
||||
int *integer);
|
||||
@@ -226,7 +226,7 @@ hexchat_get_info (hexchat_plugin *ph,
|
||||
const char *id);
|
||||
|
||||
int
|
||||
xchat_get_prefs (hexchat_plugin *ph,
|
||||
hexchat_get_prefs (hexchat_plugin *ph,
|
||||
const char *name,
|
||||
const char **string,
|
||||
int *integer);
|
||||
@@ -345,7 +345,7 @@ hexchat_pluginpref_list (hexchat_plugin *ph,
|
||||
#define hexchat_find_context ((HEXCHAT_PLUGIN_HANDLE)->hexchat_find_context)
|
||||
#define hexchat_get_context ((HEXCHAT_PLUGIN_HANDLE)->hexchat_get_context)
|
||||
#define hexchat_get_info ((HEXCHAT_PLUGIN_HANDLE)->hexchat_get_info)
|
||||
#define xchat_get_prefs ((HEXCHAT_PLUGIN_HANDLE)->xchat_get_prefs)
|
||||
#define hexchat_get_prefs ((HEXCHAT_PLUGIN_HANDLE)->hexchat_get_prefs)
|
||||
#define hexchat_list_get ((HEXCHAT_PLUGIN_HANDLE)->hexchat_list_get)
|
||||
#define hexchat_list_free ((HEXCHAT_PLUGIN_HANDLE)->hexchat_list_free)
|
||||
#define hexchat_list_fields ((HEXCHAT_PLUGIN_HANDLE)->hexchat_list_fields)
|
||||
|
||||
@@ -262,7 +262,7 @@ plugin_add (session *sess, char *filename, void *handle, void *init_func,
|
||||
pl->hexchat_find_context = hexchat_find_context;
|
||||
pl->hexchat_get_context = hexchat_get_context;
|
||||
pl->hexchat_get_info = hexchat_get_info;
|
||||
pl->xchat_get_prefs = xchat_get_prefs;
|
||||
pl->hexchat_get_prefs = hexchat_get_prefs;
|
||||
pl->hexchat_list_get = hexchat_list_get;
|
||||
pl->hexchat_list_free = hexchat_list_free;
|
||||
pl->hexchat_list_fields = hexchat_list_fields;
|
||||
@@ -1137,7 +1137,7 @@ hexchat_get_info (hexchat_plugin *ph, const char *id)
|
||||
}
|
||||
|
||||
int
|
||||
xchat_get_prefs (hexchat_plugin *ph, const char *name, const char **string, int *integer)
|
||||
hexchat_get_prefs (hexchat_plugin *ph, const char *name, const char **string, int *integer)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ struct _hexchat_plugin
|
||||
hexchat_context *(*hexchat_get_context) (hexchat_plugin *ph);
|
||||
const char *(*hexchat_get_info) (hexchat_plugin *ph,
|
||||
const char *id);
|
||||
int (*xchat_get_prefs) (hexchat_plugin *ph,
|
||||
int (*hexchat_get_prefs) (hexchat_plugin *ph,
|
||||
const char *name,
|
||||
const char **string,
|
||||
int *integer);
|
||||
|
||||
Reference in New Issue
Block a user