mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
HEXCHAT -> ZOITECHAT
This commit is contained in:
@@ -135,7 +135,7 @@ dccrecv_cb (char *word[], void *userdata)
|
||||
if (!filename_fs) {
|
||||
zoitechat_printf (ph, "Checksum: Invalid filename (%s)\n", filename);
|
||||
g_free (filename);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
ChecksumCallbackInfo *callback_data = g_new (ChecksumCallbackInfo, 1);
|
||||
@@ -153,7 +153,7 @@ dccrecv_cb (char *word[], void *userdata)
|
||||
g_object_unref (file);
|
||||
g_object_unref (task);
|
||||
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -177,7 +177,7 @@ dccoffer_cb (char *word[], void *userdata)
|
||||
g_object_unref (file);
|
||||
g_object_unref (task);
|
||||
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -189,8 +189,8 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
zoitechat_hook_print (ph, "DCC RECV Complete", HEXCHAT_PRI_NORM, dccrecv_cb, NULL);
|
||||
zoitechat_hook_print (ph, "DCC Offer", HEXCHAT_PRI_NORM, dccoffer_cb, NULL);
|
||||
zoitechat_hook_print (ph, "DCC RECV Complete", ZOITECHAT_PRI_NORM, dccrecv_cb, NULL);
|
||||
zoitechat_hook_print (ph, "DCC Offer", ZOITECHAT_PRI_NORM, dccoffer_cb, NULL);
|
||||
|
||||
zoitechat_printf (ph, "%s plugin loaded\n", name);
|
||||
return 1;
|
||||
|
||||
@@ -134,7 +134,7 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
||||
zoitechat_command (ph, "help exec");
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -146,7 +146,7 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
zoitechat_hook_command (ph, "EXEC", HEXCHAT_PRI_NORM, run_command, "Usage: /EXEC [-O] - execute commands inside ZoiteChat", 0);
|
||||
zoitechat_hook_command (ph, "EXEC", ZOITECHAT_PRI_NORM, run_command, "Usage: /EXEC [-O] - execute commands inside ZoiteChat", 0);
|
||||
zoitechat_printf (ph, "%s plugin loaded\n", name);
|
||||
|
||||
return 1; /* return 1 for success */
|
||||
|
||||
@@ -283,7 +283,7 @@ char *decrypt_raw_message(const char *message, const char *key) {
|
||||
zoitechat_printf(ph, ">%s< ", word[i]);
|
||||
}
|
||||
zoitechat_printf(ph, "\n");
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}*/
|
||||
|
||||
/**
|
||||
@@ -299,7 +299,7 @@ static int handle_outgoing(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *channel = zoitechat_get_info(ph, "channel");
|
||||
|
||||
/* Check if we can encrypt */
|
||||
if (!fish_nick_has_key(channel)) return HEXCHAT_EAT_NONE;
|
||||
if (!fish_nick_has_key(channel)) return ZOITECHAT_EAT_NONE;
|
||||
|
||||
command = g_string_new("");
|
||||
g_string_printf(command, "PRIVMSG %s :+OK ", channel);
|
||||
@@ -307,7 +307,7 @@ static int handle_outgoing(char *word[], char *word_eol[], void *userdata) {
|
||||
encrypted_list = fish_encrypt_for_nick(channel, word_eol[1], &mode, get_prefix_length() + command->len);
|
||||
if (!encrypted_list) {
|
||||
g_string_free(command, TRUE);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
/* Get prefix for own nick if any */
|
||||
@@ -333,7 +333,7 @@ static int handle_outgoing(char *word[], char *word_eol[], void *userdata) {
|
||||
g_string_free(command, TRUE);
|
||||
g_slist_free_full(encrypted_list, g_free);
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,7 +350,7 @@ static int handle_incoming(char *word[], char *word_eol[], zoitechat_event_attrs
|
||||
GString *message;
|
||||
|
||||
if (!irc_parse_message((const char **)word, &prefix, &command, ¶meters_offset))
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* Topic (command 332) has an extra parameter */
|
||||
if (!strcmp(command, "332"))
|
||||
@@ -367,7 +367,7 @@ static int handle_incoming(char *word[], char *word_eol[], zoitechat_event_attrs
|
||||
|
||||
/* Nothing to decrypt */
|
||||
if (decrypted == NULL)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* Build decrypted message */
|
||||
|
||||
@@ -395,7 +395,7 @@ static int handle_incoming(char *word[], char *word_eol[], zoitechat_event_attrs
|
||||
zoitechat_command(ph, message->str);
|
||||
g_string_free (message, TRUE);
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
@@ -407,10 +407,10 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
enum fish_mode mode = FISH_ECB_MODE;
|
||||
|
||||
if (!*dh_message || !*dh_pubkey || strlen(dh_pubkey) != 181)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
if (!irc_parse_message((const char**)word, &prefix, NULL, NULL) || !prefix)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
sender = irc_prefix_get_nick(prefix);
|
||||
query_ctx = find_context_on_network(sender);
|
||||
@@ -447,7 +447,7 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
} else {
|
||||
/* Regular notice */
|
||||
g_free(sender);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
if (dh1080_compute_key(priv_key, dh_pubkey, &secret_key)) {
|
||||
@@ -461,7 +461,7 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
cleanup:
|
||||
g_free(sender);
|
||||
g_free(priv_key);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -475,7 +475,7 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
||||
/* Check syntax */
|
||||
if (*word[2] == '\0') {
|
||||
zoitechat_printf(ph, "%s\n", usage_setkey);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
if (*word[3] == '\0') {
|
||||
@@ -503,7 +503,7 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_printf(ph, "\00305Failed to store key in addon_fishlim.conf\n");
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -523,7 +523,7 @@ static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
|
||||
/* Only allow channel or dialog */
|
||||
if (ctx_type < 2 || ctx_type > 3) {
|
||||
zoitechat_printf(ph, "%s\n", usage_delkey);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
|
||||
}
|
||||
g_free(nick);
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
@@ -558,7 +558,7 @@ static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
if ((query_ctx && ctx_type != 3) || (!query_ctx && !irc_is_query(target))) {
|
||||
zoitechat_print(ph, "You can only exchange keys with individuals");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (dh1080_generate_key(&priv_key, &pub_key)) {
|
||||
@@ -572,7 +572,7 @@ static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_print(ph, "Failed to generate keys");
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,12 +587,12 @@ static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
if (!*topic) {
|
||||
zoitechat_print(ph, usage_topic);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (zoitechat_list_int(ph, NULL, "type") != 2) {
|
||||
zoitechat_printf(ph, "Please change to the channel window where you want to set the topic!");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
target = zoitechat_get_info(ph, "channel");
|
||||
@@ -600,7 +600,7 @@ static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
/* Check if we can encrypt */
|
||||
if (!fish_nick_has_key(target)) {
|
||||
zoitechat_printf(ph, "/topic+ error, no key found for %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
command = g_string_new("");
|
||||
@@ -610,7 +610,7 @@ static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
if (!encrypted_list) {
|
||||
g_string_free(command, TRUE);
|
||||
zoitechat_printf(ph, "/topic+ error, can't encrypt %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
zoitechat_commandf(ph, "%s%s", command->str, (char *) encrypted_list->data);
|
||||
@@ -618,7 +618,7 @@ static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
g_string_free(command, TRUE);
|
||||
g_slist_free_full(encrypted_list, g_free);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -634,13 +634,13 @@ static int handle_crypt_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
if (!*target || !*notice) {
|
||||
zoitechat_print(ph, usage_notice);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/* Check if we can encrypt */
|
||||
if (!fish_nick_has_key(target)) {
|
||||
zoitechat_printf(ph, "/notice+ error, no key found for %s.", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
command = g_string_new("");
|
||||
@@ -650,7 +650,7 @@ static int handle_crypt_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
if (!encrypted_list) {
|
||||
g_string_free(command, TRUE);
|
||||
zoitechat_printf(ph, "/notice+ error, can't encrypt %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
notice_flag = g_strconcat("[", fish_modes[mode], "] ", notice, NULL);
|
||||
@@ -668,7 +668,7 @@ static int handle_crypt_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
g_string_free(command, TRUE);
|
||||
g_slist_free_full(encrypted_list, g_free);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,13 +686,13 @@ static int handle_crypt_msg(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
if (!*target || !*message) {
|
||||
zoitechat_print(ph, usage_msg);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/* Check if we can encrypt */
|
||||
if (!fish_nick_has_key(target)) {
|
||||
zoitechat_printf(ph, "/msg+ error, no key found for %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
command = g_string_new("");
|
||||
@@ -702,7 +702,7 @@ static int handle_crypt_msg(char *word[], char *word_eol[], void *userdata) {
|
||||
if (!encrypted_list) {
|
||||
g_string_free(command, TRUE);
|
||||
zoitechat_printf(ph, "/msg+ error, can't encrypt %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/* Send encrypted messages */
|
||||
@@ -731,7 +731,7 @@ static int handle_crypt_msg(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_emit_print(ph, "Message Send", target, message);
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
static int handle_crypt_me(char *word[], char *word_eol[], void *userdata) {
|
||||
@@ -742,7 +742,7 @@ static int handle_crypt_me(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
/* Check if we can encrypt */
|
||||
if (!fish_nick_has_key(channel)) {
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
command = g_string_new("");
|
||||
@@ -753,7 +753,7 @@ static int handle_crypt_me(char *word[], char *word_eol[], void *userdata) {
|
||||
if (!encrypted_list) {
|
||||
g_string_free(command, TRUE);
|
||||
zoitechat_printf(ph, "/me error, can't encrypt %s", channel);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
zoitechat_emit_print(ph, "Your Action", zoitechat_get_info(ph, "nick"), word_eol[2], NULL);
|
||||
@@ -769,7 +769,7 @@ static int handle_crypt_me(char *word[], char *word_eol[], void *userdata) {
|
||||
g_string_free(command, TRUE);
|
||||
g_slist_free_full(encrypted_list, g_free);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -798,22 +798,22 @@ int zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
*version = plugin_version;
|
||||
|
||||
/* Register commands */
|
||||
zoitechat_hook_command(ph, "SETKEY", HEXCHAT_PRI_NORM, handle_setkey, usage_setkey, NULL);
|
||||
zoitechat_hook_command(ph, "DELKEY", HEXCHAT_PRI_NORM, handle_delkey, usage_delkey, NULL);
|
||||
zoitechat_hook_command(ph, "KEYX", HEXCHAT_PRI_NORM, handle_keyx, usage_keyx, NULL);
|
||||
zoitechat_hook_command(ph, "TOPIC+", HEXCHAT_PRI_NORM, handle_crypt_topic, usage_topic, NULL);
|
||||
zoitechat_hook_command(ph, "NOTICE+", HEXCHAT_PRI_NORM, handle_crypt_notice, usage_notice, NULL);
|
||||
zoitechat_hook_command(ph, "MSG+", HEXCHAT_PRI_NORM, handle_crypt_msg, usage_msg, NULL);
|
||||
zoitechat_hook_command(ph, "ME", HEXCHAT_PRI_NORM, handle_crypt_me, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "SETKEY", ZOITECHAT_PRI_NORM, handle_setkey, usage_setkey, NULL);
|
||||
zoitechat_hook_command(ph, "DELKEY", ZOITECHAT_PRI_NORM, handle_delkey, usage_delkey, NULL);
|
||||
zoitechat_hook_command(ph, "KEYX", ZOITECHAT_PRI_NORM, handle_keyx, usage_keyx, NULL);
|
||||
zoitechat_hook_command(ph, "TOPIC+", ZOITECHAT_PRI_NORM, handle_crypt_topic, usage_topic, NULL);
|
||||
zoitechat_hook_command(ph, "NOTICE+", ZOITECHAT_PRI_NORM, handle_crypt_notice, usage_notice, NULL);
|
||||
zoitechat_hook_command(ph, "MSG+", ZOITECHAT_PRI_NORM, handle_crypt_msg, usage_msg, NULL);
|
||||
zoitechat_hook_command(ph, "ME", ZOITECHAT_PRI_NORM, handle_crypt_me, NULL, NULL);
|
||||
|
||||
/* Add handlers */
|
||||
zoitechat_hook_command(ph, "", HEXCHAT_PRI_NORM, handle_outgoing, NULL, NULL);
|
||||
zoitechat_hook_server(ph, "NOTICE", HEXCHAT_PRI_HIGHEST, handle_keyx_notice, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "NOTICE", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "PRIVMSG", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
/* zoitechat_hook_server(ph, "RAW LINE", HEXCHAT_PRI_NORM, handle_debug, NULL); */
|
||||
zoitechat_hook_server_attrs(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_command(ph, "", ZOITECHAT_PRI_NORM, handle_outgoing, NULL, NULL);
|
||||
zoitechat_hook_server(ph, "NOTICE", ZOITECHAT_PRI_HIGHEST, handle_keyx_notice, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "NOTICE", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "PRIVMSG", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
/* zoitechat_hook_server(ph, "RAW LINE", ZOITECHAT_PRI_NORM, handle_debug, NULL); */
|
||||
zoitechat_hook_server_attrs(ph, "TOPIC", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "332", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
|
||||
if (!fish_init())
|
||||
return 0;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef PLUGIN_HEXCHAT_H
|
||||
#define PLUGIN_HEXCHAT_H
|
||||
#ifndef PLUGIN_ZOITECHAT_H
|
||||
#define PLUGIN_ZOITECHAT_H
|
||||
|
||||
gchar *get_config_filename(void);
|
||||
int irc_nick_cmp (const char *, const char *);
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef PLUGIN_HEXCHAT_FISHLIM_UTILS_H
|
||||
#define PLUGIN_HEXCHAT_FISHLIM_UTILS_H
|
||||
#ifndef PLUGIN_ZOITECHAT_FISHLIM_UTILS_H
|
||||
#define PLUGIN_ZOITECHAT_FISHLIM_UTILS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "fish.h"
|
||||
|
||||
@@ -295,7 +295,7 @@ static int api_command_closure(char *word[], char *word_eol[], void *udata)
|
||||
lua_pop(L, 2);
|
||||
zoitechat_printf(ph, "Lua error in command hook: %s", error ? error : "(non-string error)");
|
||||
check_deferred(script);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
ret = lua_tointeger(L, -1);
|
||||
lua_pop(L, 2);
|
||||
@@ -313,7 +313,7 @@ static int api_zoitechat_hook_command(lua_State *L)
|
||||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
help = luaL_optstring(L, 3, NULL);
|
||||
pri = luaL_optinteger(L, 4, HEXCHAT_PRI_NORM);
|
||||
pri = luaL_optinteger(L, 4, ZOITECHAT_PRI_NORM);
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
@@ -355,7 +355,7 @@ static int api_print_closure(char *word[], void *udata)
|
||||
lua_pop(L, 2);
|
||||
zoitechat_printf(ph, "Lua error in print hook: %s", error ? error : "(non-string error)");
|
||||
check_deferred(script);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
ret = lua_tointeger(L, -1);
|
||||
lua_pop(L, 2);
|
||||
@@ -371,7 +371,7 @@ static int api_zoitechat_hook_print(lua_State *L)
|
||||
|
||||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
|
||||
pri = luaL_optinteger(L, 3, ZOITECHAT_PRI_NORM);
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
@@ -424,7 +424,7 @@ static int api_print_attrs_closure(char *word[], zoitechat_event_attrs *attrs, v
|
||||
lua_pop(L, 2);
|
||||
zoitechat_printf(ph, "Lua error in print_attrs hook: %s", error ? error : "(non-string error)");
|
||||
check_deferred(script);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
ret = lua_tointeger(L, -1);
|
||||
lua_pop(L, 2);
|
||||
@@ -440,7 +440,7 @@ static int api_zoitechat_hook_print_attrs(lua_State *L)
|
||||
|
||||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
|
||||
pri = luaL_optinteger(L, 3, ZOITECHAT_PRI_NORM);
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
@@ -482,7 +482,7 @@ static int api_server_closure(char *word[], char *word_eol[], void *udata)
|
||||
lua_pop(L, 2);
|
||||
zoitechat_printf(ph, "Lua error in server hook: %s", error ? error : "(non-string error)");
|
||||
check_deferred(script);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
ret = lua_tointeger(L, -1);
|
||||
lua_pop(L, 2);
|
||||
@@ -498,7 +498,7 @@ static int api_zoitechat_hook_server(lua_State *L)
|
||||
|
||||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
|
||||
pri = luaL_optinteger(L, 3, ZOITECHAT_PRI_NORM);
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
@@ -546,7 +546,7 @@ static int api_server_attrs_closure(char *word[], char *word_eol[], zoitechat_ev
|
||||
lua_pop(L, 2);
|
||||
zoitechat_printf(ph, "Lua error in server_attrs hook: %s", error ? error : "(non-string error)");
|
||||
check_deferred(script);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
ret = lua_tointeger(L, -1);
|
||||
lua_pop(L, 2);
|
||||
@@ -562,7 +562,7 @@ static int api_zoitechat_hook_server_attrs(lua_State *L)
|
||||
|
||||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
|
||||
pri = luaL_optinteger(L, 3, ZOITECHAT_PRI_NORM);
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
@@ -1098,15 +1098,15 @@ static int luaopen_zoitechat(lua_State *L)
|
||||
lua_newtable(L);
|
||||
luaL_setfuncs(L, api_zoitechat, 0);
|
||||
|
||||
lua_pushinteger(L, HEXCHAT_PRI_HIGHEST); lua_setfield(L, -2, "PRI_HIGHEST");
|
||||
lua_pushinteger(L, HEXCHAT_PRI_HIGH); lua_setfield(L, -2, "PRI_HIGH");
|
||||
lua_pushinteger(L, HEXCHAT_PRI_NORM); lua_setfield(L, -2, "PRI_NORM");
|
||||
lua_pushinteger(L, HEXCHAT_PRI_LOW); lua_setfield(L, -2, "PRI_LOW");
|
||||
lua_pushinteger(L, HEXCHAT_PRI_LOWEST); lua_setfield(L, -2, "PRI_LOWEST");
|
||||
lua_pushinteger(L, HEXCHAT_EAT_NONE); lua_setfield(L, -2, "EAT_NONE");
|
||||
lua_pushinteger(L, HEXCHAT_EAT_HEXCHAT); lua_setfield(L, -2, "EAT_HEXCHAT");
|
||||
lua_pushinteger(L, HEXCHAT_EAT_PLUGIN); lua_setfield(L, -2, "EAT_PLUGIN");
|
||||
lua_pushinteger(L, HEXCHAT_EAT_ALL); lua_setfield(L, -2, "EAT_ALL");
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_HIGHEST); lua_setfield(L, -2, "PRI_HIGHEST");
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_HIGH); lua_setfield(L, -2, "PRI_HIGH");
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_NORM); lua_setfield(L, -2, "PRI_NORM");
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_LOW); lua_setfield(L, -2, "PRI_LOW");
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_LOWEST); lua_setfield(L, -2, "PRI_LOWEST");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_NONE); lua_setfield(L, -2, "EAT_NONE");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ZOITECHAT); lua_setfield(L, -2, "EAT_ZOITECHAT");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_PLUGIN); lua_setfield(L, -2, "EAT_PLUGIN");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ALL); lua_setfield(L, -2, "EAT_ALL");
|
||||
|
||||
lua_newtable(L);
|
||||
lua_newtable(L);
|
||||
@@ -1576,26 +1576,26 @@ static int command_load(char *word[], char *word_eol[], void *userdata)
|
||||
if(is_lua_file(word[2]))
|
||||
{
|
||||
load_script(word[2]);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
else
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int command_unload(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
if(unload_script(word[2]))
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
else
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int command_reload(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
if(reload_script(word[2]))
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
else
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int command_console_exec(char *word[], char *word_eol[], void *userdata)
|
||||
@@ -1608,9 +1608,9 @@ static int command_console_exec(char *word[], char *word_eol[], void *userdata)
|
||||
zoitechat_printf(ph, "> %s", word_eol[1]);
|
||||
inject_string(interp, word_eol[1]);
|
||||
}
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static void check_deferred(script_info *info)
|
||||
@@ -1727,7 +1727,7 @@ static int command_lua(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
zoitechat_command(ph, "help lua");
|
||||
}
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/* Reinitialization safegaurd */
|
||||
@@ -1754,11 +1754,11 @@ G_MODULE_EXPORT int zoitechat_plugin_init(zoitechat_plugin *plugin_handle, char
|
||||
ph = plugin_handle;
|
||||
initialized = 1;
|
||||
|
||||
zoitechat_hook_command(ph, "", HEXCHAT_PRI_NORM, command_console_exec, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "LOAD", HEXCHAT_PRI_NORM, command_load, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "UNLOAD", HEXCHAT_PRI_NORM, command_unload, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "RELOAD", HEXCHAT_PRI_NORM, command_reload, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "lua", HEXCHAT_PRI_NORM, command_lua, command_help, NULL);
|
||||
zoitechat_hook_command(ph, "", ZOITECHAT_PRI_NORM, command_console_exec, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "LOAD", ZOITECHAT_PRI_NORM, command_load, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "UNLOAD", ZOITECHAT_PRI_NORM, command_unload, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "RELOAD", ZOITECHAT_PRI_NORM, command_reload, NULL, NULL);
|
||||
zoitechat_hook_command(ph, "lua", ZOITECHAT_PRI_NORM, command_lua, command_help, NULL);
|
||||
|
||||
zoitechat_printf(ph, "%s version %s loaded.\n", plugin_name, plugin_version);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ sub PRI_LOW ();
|
||||
sub PRI_LOWEST ();
|
||||
|
||||
sub EAT_NONE ();
|
||||
sub EAT_HEXCHAT ();
|
||||
sub EAT_ZOITECHAT ();
|
||||
sub EAT_PLUGIN ();
|
||||
sub EAT_ALL ();
|
||||
|
||||
@@ -60,7 +60,7 @@ BEGIN {
|
||||
our %EXPORT_TAGS = (
|
||||
constants => [
|
||||
qw(PRI_HIGHEST PRI_HIGH PRI_NORM PRI_LOW PRI_LOWEST), # priorities
|
||||
qw(EAT_NONE EAT_HEXCHAT EAT_XCHAT EAT_PLUGIN EAT_ALL), # callback return values
|
||||
qw(EAT_NONE EAT_ZOITECHAT EAT_XCHAT EAT_PLUGIN EAT_ALL), # callback return values
|
||||
qw(FD_READ FD_WRITE FD_EXCEPTION FD_NOTSOCKET), # fd flags
|
||||
qw(KEEP REMOVE), # timers
|
||||
],
|
||||
|
||||
@@ -247,7 +247,7 @@ sub evaluate {
|
||||
ZoiteChat::print $results[0];
|
||||
}
|
||||
|
||||
return ZoiteChat::EAT_HEXCHAT;
|
||||
return ZoiteChat::EAT_ZOITECHAT;
|
||||
};
|
||||
|
||||
sub expand_homedir {
|
||||
|
||||
@@ -337,11 +337,11 @@ fd_cb (int fd, int flags, void *userdata)
|
||||
if (SvTRUE (ERRSV)) {
|
||||
zoitechat_printf (ph, "Error in fd callback %s", SvPV_nolen (ERRSV));
|
||||
if (!SvOK (POPs)) {} /* remove undef from the top of the stack */
|
||||
retVal = HEXCHAT_EAT_ALL;
|
||||
retVal = ZOITECHAT_EAT_ALL;
|
||||
} else {
|
||||
if (count != 1) {
|
||||
zoitechat_print (ph, "Fd handler should only return 1 value.");
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
retVal = POPi;
|
||||
if (retVal == 0) {
|
||||
@@ -398,11 +398,11 @@ timer_cb (void *userdata)
|
||||
if (SvTRUE (ERRSV)) {
|
||||
zoitechat_printf (ph, "Error in timer callback %s", SvPV_nolen (ERRSV));
|
||||
if (!SvOK (POPs)) {} /* remove undef from the top of the stack */
|
||||
retVal = HEXCHAT_EAT_ALL;
|
||||
retVal = ZOITECHAT_EAT_ALL;
|
||||
} else {
|
||||
if (count != 1) {
|
||||
zoitechat_print (ph, "Timer handler should only return 1 value.");
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
retVal = POPi;
|
||||
if (retVal == 0) {
|
||||
@@ -438,7 +438,7 @@ server_cb (char *word[], char *word_eol[], void *userdata)
|
||||
SAVETMPS;
|
||||
|
||||
if (data->depth)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* zoitechat_printf (ph, */
|
||||
/* "Received %d words in server callback", av_len (wd)); */
|
||||
@@ -457,11 +457,11 @@ server_cb (char *word[], char *word_eol[], void *userdata)
|
||||
if (SvTRUE (ERRSV)) {
|
||||
zoitechat_printf (ph, "Error in server callback %s", SvPV_nolen (ERRSV));
|
||||
if (!SvOK (POPs)) {} /* remove undef from the top of the stack */
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
if (count != 1) {
|
||||
zoitechat_print (ph, "Server handler should only return 1 value.");
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
retVal = POPi;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ command_cb (char *word[], char *word_eol[], void *userdata)
|
||||
SAVETMPS;
|
||||
|
||||
if (data->depth)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* zoitechat_printf (ph, "Received %d words in command callback", */
|
||||
/* av_len (wd)); */
|
||||
@@ -506,11 +506,11 @@ command_cb (char *word[], char *word_eol[], void *userdata)
|
||||
if (SvTRUE (ERRSV)) {
|
||||
zoitechat_printf (ph, "Error in command callback %s", SvPV_nolen (ERRSV));
|
||||
if (!SvOK (POPs)) {} /* remove undef from the top of the stack */
|
||||
retVal = HEXCHAT_EAT_HEXCHAT;
|
||||
retVal = ZOITECHAT_EAT_ZOITECHAT;
|
||||
} else {
|
||||
if (count != 1) {
|
||||
zoitechat_print (ph, "Command handler should only return 1 value.");
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
retVal = POPi;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ print_cb (char *word[], void *userdata)
|
||||
SAVETMPS;
|
||||
|
||||
if (data->depth)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
wd = newAV ();
|
||||
sv_2mortal ((SV *) wd);
|
||||
@@ -582,11 +582,11 @@ print_cb (char *word[], void *userdata)
|
||||
if (SvTRUE (ERRSV)) {
|
||||
zoitechat_printf (ph, "Error in print callback %s", SvPV_nolen (ERRSV));
|
||||
if (!SvOK (POPs)) {} /* remove undef from the top of the stack */
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
if (count != 1) {
|
||||
zoitechat_print (ph, "Print handler should only return 1 value.");
|
||||
retVal = HEXCHAT_EAT_NONE;
|
||||
retVal = ZOITECHAT_EAT_NONE;
|
||||
} else {
|
||||
retVal = POPi;
|
||||
}
|
||||
@@ -1022,7 +1022,7 @@ XS (XS_ZoiteChat_hook_fd)
|
||||
data = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
if ((flags & HEXCHAT_FD_NOTSOCKET) == 0) {
|
||||
if ((flags & ZOITECHAT_FD_NOTSOCKET) == 0) {
|
||||
/* this _get_osfhandle if from win32iop.h in the perl distribution,
|
||||
* not the one provided by Windows
|
||||
*/
|
||||
@@ -1356,21 +1356,21 @@ xs_init (pTHX)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
newCONSTSUB (stash, "PRI_HIGHEST", newSViv (HEXCHAT_PRI_HIGHEST));
|
||||
newCONSTSUB (stash, "PRI_HIGH", newSViv (HEXCHAT_PRI_HIGH));
|
||||
newCONSTSUB (stash, "PRI_NORM", newSViv (HEXCHAT_PRI_NORM));
|
||||
newCONSTSUB (stash, "PRI_LOW", newSViv (HEXCHAT_PRI_LOW));
|
||||
newCONSTSUB (stash, "PRI_LOWEST", newSViv (HEXCHAT_PRI_LOWEST));
|
||||
newCONSTSUB (stash, "PRI_HIGHEST", newSViv (ZOITECHAT_PRI_HIGHEST));
|
||||
newCONSTSUB (stash, "PRI_HIGH", newSViv (ZOITECHAT_PRI_HIGH));
|
||||
newCONSTSUB (stash, "PRI_NORM", newSViv (ZOITECHAT_PRI_NORM));
|
||||
newCONSTSUB (stash, "PRI_LOW", newSViv (ZOITECHAT_PRI_LOW));
|
||||
newCONSTSUB (stash, "PRI_LOWEST", newSViv (ZOITECHAT_PRI_LOWEST));
|
||||
|
||||
newCONSTSUB (stash, "EAT_NONE", newSViv (HEXCHAT_EAT_NONE));
|
||||
newCONSTSUB (stash, "EAT_HEXCHAT", newSViv (HEXCHAT_EAT_HEXCHAT));
|
||||
newCONSTSUB (stash, "EAT_XCHAT", newSViv (HEXCHAT_EAT_HEXCHAT)); /* for compatibility */
|
||||
newCONSTSUB (stash, "EAT_PLUGIN", newSViv (HEXCHAT_EAT_PLUGIN));
|
||||
newCONSTSUB (stash, "EAT_ALL", newSViv (HEXCHAT_EAT_ALL));
|
||||
newCONSTSUB (stash, "FD_READ", newSViv (HEXCHAT_FD_READ));
|
||||
newCONSTSUB (stash, "FD_WRITE", newSViv (HEXCHAT_FD_WRITE));
|
||||
newCONSTSUB (stash, "FD_EXCEPTION", newSViv (HEXCHAT_FD_EXCEPTION));
|
||||
newCONSTSUB (stash, "FD_NOTSOCKET", newSViv (HEXCHAT_FD_NOTSOCKET));
|
||||
newCONSTSUB (stash, "EAT_NONE", newSViv (ZOITECHAT_EAT_NONE));
|
||||
newCONSTSUB (stash, "EAT_ZOITECHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT));
|
||||
newCONSTSUB (stash, "EAT_XCHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); /* for compatibility */
|
||||
newCONSTSUB (stash, "EAT_PLUGIN", newSViv (ZOITECHAT_EAT_PLUGIN));
|
||||
newCONSTSUB (stash, "EAT_ALL", newSViv (ZOITECHAT_EAT_ALL));
|
||||
newCONSTSUB (stash, "FD_READ", newSViv (ZOITECHAT_FD_READ));
|
||||
newCONSTSUB (stash, "FD_WRITE", newSViv (ZOITECHAT_FD_WRITE));
|
||||
newCONSTSUB (stash, "FD_EXCEPTION", newSViv (ZOITECHAT_FD_EXCEPTION));
|
||||
newCONSTSUB (stash, "FD_NOTSOCKET", newSViv (ZOITECHAT_FD_NOTSOCKET));
|
||||
newCONSTSUB (stash, "KEEP", newSViv (1));
|
||||
newCONSTSUB (stash, "REMOVE", newSViv (0));
|
||||
|
||||
@@ -1509,10 +1509,10 @@ perl_command_unloadall (char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
if (my_perl != NULL) {
|
||||
execute_perl (sv_2mortal (newSVpv ("ZoiteChat::Embed::unload_all", 0)), "");
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1521,11 +1521,11 @@ perl_command_reloadall (char *word[], char *word_eol[], void *userdata)
|
||||
if (my_perl != NULL) {
|
||||
execute_perl (sv_2mortal (newSVpv ("ZoiteChat::Embed::reload_all", 0)), "");
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
} else {
|
||||
perl_auto_load( NULL );
|
||||
}
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1536,10 +1536,10 @@ perl_command_load (char *word[], char *word_eol[], void *userdata)
|
||||
if (file != NULL )
|
||||
{
|
||||
perl_load_file (file);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1549,10 +1549,10 @@ perl_command_unload (char *word[], char *word_eol[], void *userdata)
|
||||
|
||||
if (my_perl != NULL && file != NULL) {
|
||||
execute_perl (sv_2mortal (newSVpv ("ZoiteChat::Embed::unload", 0)), file);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1562,13 +1562,13 @@ perl_command_reload (char *word[], char *word_eol[], void *eat)
|
||||
|
||||
if (my_perl != NULL && file != NULL) {
|
||||
execute_perl (sv_2mortal (newSVpv ("ZoiteChat::Embed::reload", 0)), file);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
if (eat)
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
else
|
||||
return HEXCHAT_EAT_NONE;
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1577,7 +1577,7 @@ perl_command_eval (char *word[], char *word_eol[], void *userdata)
|
||||
if (my_perl != NULL)
|
||||
execute_perl (sv_2mortal (newSVpv ("ZoiteChat::Embed::evaluate", 0)), word_eol[2]);
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
return ZOITECHAT_EAT_ZOITECHAT;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1612,19 +1612,19 @@ zoitechat_plugin_init (zoitechat_plugin * plugin_handle, char **plugin_name,
|
||||
*plugin_desc = "Perl scripting interface";
|
||||
*plugin_version = PACKAGE_VERSION;
|
||||
|
||||
zoitechat_hook_command (ph, "load", HEXCHAT_PRI_NORM, perl_command_load, 0, 0);
|
||||
zoitechat_hook_command (ph, "unload", HEXCHAT_PRI_NORM, perl_command_unload, 0,
|
||||
zoitechat_hook_command (ph, "load", ZOITECHAT_PRI_NORM, perl_command_load, 0, 0);
|
||||
zoitechat_hook_command (ph, "unload", ZOITECHAT_PRI_NORM, perl_command_unload, 0,
|
||||
0);
|
||||
zoitechat_hook_command (ph, "reload", HEXCHAT_PRI_NORM, perl_command_reload, 0,
|
||||
zoitechat_hook_command (ph, "reload", ZOITECHAT_PRI_NORM, perl_command_reload, 0,
|
||||
0);
|
||||
zoitechat_hook_command (ph, "pl_reload", HEXCHAT_PRI_NORM, perl_command_reload,
|
||||
zoitechat_hook_command (ph, "pl_reload", ZOITECHAT_PRI_NORM, perl_command_reload,
|
||||
"Reloads a Perl script. Syntax: /pl_reload <filename.pl>", (int*)1);
|
||||
zoitechat_hook_command (ph, "unloadall", HEXCHAT_PRI_NORM,
|
||||
zoitechat_hook_command (ph, "unloadall", ZOITECHAT_PRI_NORM,
|
||||
perl_command_unloadall, "Unloads all loaded Perl scripts.", 0);
|
||||
zoitechat_hook_command (ph, "reloadall", HEXCHAT_PRI_NORM,
|
||||
zoitechat_hook_command (ph, "reloadall", ZOITECHAT_PRI_NORM,
|
||||
perl_command_reloadall, "Realoads all loaded Perl scripts.", 0);
|
||||
|
||||
zoitechat_hook_command (ph, "pl", HEXCHAT_PRI_NORM,
|
||||
zoitechat_hook_command (ph, "pl", ZOITECHAT_PRI_NORM,
|
||||
perl_command_eval, "Evaluates Perl code. Syntax: /pl <perl code>", 0);
|
||||
|
||||
/*perl_init (); */
|
||||
|
||||
@@ -5,7 +5,7 @@ from contextlib import contextmanager
|
||||
from _zoitechat_embedded import ffi, lib
|
||||
|
||||
__all__ = [
|
||||
'EAT_ALL', 'EAT_HEXCHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT',
|
||||
'EAT_ALL', 'EAT_ZOITECHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT',
|
||||
'PRI_HIGH', 'PRI_HIGHEST', 'PRI_LOW', 'PRI_LOWEST', 'PRI_NORM',
|
||||
'__doc__', '__version__', 'command', 'del_pluginpref', 'emit_print',
|
||||
'find_context', 'get_context', 'get_info',
|
||||
@@ -20,10 +20,10 @@ __version__ = (2, 0)
|
||||
__license__ = 'GPL-2.0+'
|
||||
|
||||
EAT_NONE = 0
|
||||
EAT_HEXCHAT = 1
|
||||
EAT_XCHAT = EAT_HEXCHAT
|
||||
EAT_ZOITECHAT = 1
|
||||
EAT_XCHAT = EAT_ZOITECHAT
|
||||
EAT_PLUGIN = 2
|
||||
EAT_ALL = EAT_HEXCHAT | EAT_PLUGIN
|
||||
EAT_ALL = EAT_ZOITECHAT | EAT_PLUGIN
|
||||
|
||||
PRI_LOWEST = -128
|
||||
PRI_LOW = -64
|
||||
|
||||
@@ -13,7 +13,7 @@ with open(sys.argv[1]) as f:
|
||||
for line in f:
|
||||
if line.startswith('#define'):
|
||||
continue
|
||||
elif line.endswith('HEXCHAT_PLUGIN_H\n'):
|
||||
elif line.endswith('ZOITECHAT_PLUGIN_H\n'):
|
||||
continue
|
||||
elif 'time.h' in line:
|
||||
output.append('typedef int... time_t;')
|
||||
@@ -70,7 +70,7 @@ int zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
}
|
||||
|
||||
ph = plugin_handle;
|
||||
return _on_plugin_init(name_out, description_out, version_out, arg, HEXCHATLIBDIR);
|
||||
return _on_plugin_init(name_out, description_out, version_out, arg, ZOITECHATLIBDIR);
|
||||
}
|
||||
|
||||
int zoitechat_plugin_deinit(void)
|
||||
|
||||
@@ -40,7 +40,7 @@ def redirected_stdout():
|
||||
sys.stderr = zoitechat_stdout
|
||||
|
||||
|
||||
if os.getenv('HEXCHAT_LOG_PYTHON'):
|
||||
if os.getenv('ZOITECHAT_LOG_PYTHON'):
|
||||
def log(*args):
|
||||
with redirected_stdout():
|
||||
print(*args)
|
||||
|
||||
@@ -222,7 +222,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
else
|
||||
print_info (cmd, announce);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -233,7 +233,7 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
zoitechat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
zoitechat_hook_command (ph, "SYSINFO", ZOITECHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
|
||||
zoitechat_command (ph, "MENU ADD \"Window/Send System Info\" \"SYSINFO\"");
|
||||
zoitechat_printf (ph, _("%s plugin loaded\n"), name);
|
||||
|
||||
@@ -37,7 +37,7 @@ check_cmd (char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
win_sparkle_check_update_with_ui ();
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -52,7 +52,7 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
win_sparkle_set_appcast_url (APPCAST_URL);
|
||||
win_sparkle_init ();
|
||||
|
||||
zoitechat_hook_command (ph, "UPDCHK", HEXCHAT_PRI_NORM, check_cmd, upd_help, NULL);
|
||||
zoitechat_hook_command (ph, "UPDCHK", ZOITECHAT_PRI_NORM, check_cmd, upd_help, NULL);
|
||||
zoitechat_command (ph, "MENU -ishare\\download.png ADD \"Help/Check for Updates\" \"UPDCHK\"");
|
||||
zoitechat_printf (ph, "%s plugin loaded\n", name);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ winamp(char *word[], char *word_eol[], void *userdata)
|
||||
if (!current_play)
|
||||
{
|
||||
zoitechat_print (ph, "Winamp: Error getting song information.");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (strchr(current_play, '-'))
|
||||
@@ -120,7 +120,7 @@ winamp(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
zoitechat_print(ph, "Winamp not found.\n");
|
||||
}
|
||||
return HEXCHAT_EAT_ALL;
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -137,7 +137,7 @@ zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
*plugin_desc = "Winamp plugin for ZoiteChat";
|
||||
*plugin_version = "0.6";
|
||||
|
||||
zoitechat_hook_command (ph, "WINAMP", HEXCHAT_PRI_NORM, winamp, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START] - control Winamp or show what's currently playing", 0);
|
||||
zoitechat_hook_command (ph, "WINAMP", ZOITECHAT_PRI_NORM, winamp, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START] - control Winamp or show what's currently playing", 0);
|
||||
zoitechat_command (ph, "MENU -ishare\\music.png ADD \"Window/Display Current Song (Winamp)\" \"WINAMP\"");
|
||||
|
||||
zoitechat_print (ph, "Winamp plugin loaded\n");
|
||||
|
||||
Reference in New Issue
Block a user