mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-14 01:30:19 +00:00
new name after fork
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* HexChat
|
||||
/* ZoiteChat
|
||||
* Copyright (c) 2010-2012 Berke Viktor.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include "hexchat-plugin.h"
|
||||
#include "zoitechat-plugin.h"
|
||||
|
||||
static hexchat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static char name[] = "Checksum";
|
||||
static char desc[] = "Calculate checksum for DCC file transfers";
|
||||
static char version[] = "4.0";
|
||||
@@ -43,7 +43,7 @@ static void
|
||||
print_sha256_result (ChecksumCallbackInfo *info, const char *checksum, const char *filename, GError *error)
|
||||
{
|
||||
// So then we get the next best available channel, since we always want to print at least somewhere, it's fine
|
||||
hexchat_context *ctx = hexchat_find_context(ph, info->servername, info->channel);
|
||||
zoitechat_context *ctx = zoitechat_find_context(ph, info->servername, info->channel);
|
||||
if (!ctx) {
|
||||
// before we print a private message to the wrong channel, we exit early
|
||||
if (info->send_message) {
|
||||
@@ -51,21 +51,21 @@ print_sha256_result (ChecksumCallbackInfo *info, const char *checksum, const cha
|
||||
}
|
||||
|
||||
// if the context isn't found the first time, we search in the server
|
||||
ctx = hexchat_find_context(ph, info->servername, NULL);
|
||||
ctx = zoitechat_find_context(ph, info->servername, NULL);
|
||||
if (!ctx) {
|
||||
// The second time we exit early, since printing in another server isn't desireable
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hexchat_set_context(ph, ctx);
|
||||
zoitechat_set_context(ph, ctx);
|
||||
|
||||
if (error) {
|
||||
hexchat_printf (ph, "Failed to create checksum for %s: %s\n", filename, error->message);
|
||||
zoitechat_printf (ph, "Failed to create checksum for %s: %s\n", filename, error->message);
|
||||
} else if (info->send_message) {
|
||||
hexchat_commandf (ph, "quote PRIVMSG %s :SHA-256 checksum for %s (remote): %s", hexchat_get_info (ph, "channel"), filename, checksum);
|
||||
zoitechat_commandf (ph, "quote PRIVMSG %s :SHA-256 checksum for %s (remote): %s", zoitechat_get_info (ph, "channel"), filename, checksum);
|
||||
} else {
|
||||
hexchat_printf (ph, "SHA-256 checksum for %s (local): %s\n", filename, checksum);
|
||||
zoitechat_printf (ph, "SHA-256 checksum for %s (local): %s\n", filename, checksum);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,21 +126,21 @@ dccrecv_cb (char *word[], void *userdata)
|
||||
const char *dcc_completed_dir;
|
||||
char *filename;
|
||||
|
||||
if (hexchat_get_prefs (ph, "dcc_completed_dir", &dcc_completed_dir, NULL) == 1 && dcc_completed_dir[0] != '\0')
|
||||
if (zoitechat_get_prefs (ph, "dcc_completed_dir", &dcc_completed_dir, NULL) == 1 && dcc_completed_dir[0] != '\0')
|
||||
filename = g_build_filename (dcc_completed_dir, word[1], NULL);
|
||||
else
|
||||
filename = g_strdup (word[2]);
|
||||
|
||||
filename_fs = g_filename_from_utf8 (filename, -1, NULL, NULL, NULL);
|
||||
if (!filename_fs) {
|
||||
hexchat_printf (ph, "Checksum: Invalid filename (%s)\n", filename);
|
||||
zoitechat_printf (ph, "Checksum: Invalid filename (%s)\n", filename);
|
||||
g_free (filename);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
ChecksumCallbackInfo *callback_data = g_new (ChecksumCallbackInfo, 1);
|
||||
callback_data->servername = g_strdup(hexchat_get_info(ph, "server"));
|
||||
callback_data->channel = g_strdup(hexchat_get_info(ph, "channel"));
|
||||
callback_data->servername = g_strdup(zoitechat_get_info(ph, "server"));
|
||||
callback_data->channel = g_strdup(zoitechat_get_info(ph, "channel"));
|
||||
callback_data->send_message = FALSE;
|
||||
|
||||
|
||||
@@ -164,8 +164,8 @@ dccoffer_cb (char *word[], void *userdata)
|
||||
char *filename;
|
||||
|
||||
ChecksumCallbackInfo *callback_data = g_new (ChecksumCallbackInfo, 1);
|
||||
callback_data->servername = g_strdup(hexchat_get_info(ph, "server"));
|
||||
callback_data->channel = g_strdup(hexchat_get_info(ph, "channel"));
|
||||
callback_data->servername = g_strdup(zoitechat_get_info(ph, "server"));
|
||||
callback_data->channel = g_strdup(zoitechat_get_info(ph, "channel"));
|
||||
callback_data->send_message = TRUE;
|
||||
|
||||
filename = g_strdup (word[3]);
|
||||
@@ -181,7 +181,7 @@ dccoffer_cb (char *word[], void *userdata)
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
ph = plugin_handle;
|
||||
|
||||
@@ -189,16 +189,16 @@ hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **p
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
hexchat_hook_print (ph, "DCC RECV Complete", HEXCHAT_PRI_NORM, dccrecv_cb, NULL);
|
||||
hexchat_hook_print (ph, "DCC Offer", HEXCHAT_PRI_NORM, dccoffer_cb, NULL);
|
||||
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);
|
||||
|
||||
hexchat_printf (ph, "%s plugin loaded\n", name);
|
||||
zoitechat_printf (ph, "%s plugin loaded\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit (void)
|
||||
zoitechat_plugin_deinit (void)
|
||||
{
|
||||
hexchat_printf (ph, "%s plugin unloaded\n", name);
|
||||
zoitechat_printf (ph, "%s plugin unloaded\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
EXPORTS
|
||||
hexchat_plugin_init
|
||||
hexchat_plugin_deinit
|
||||
zoitechat_plugin_init
|
||||
zoitechat_plugin_deinit
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<Import Project="..\..\win32\zoitechat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcchecksum</TargetName>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
<OutDir>$(ZoiteChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>checksum.def</ModuleDefinitionFile>
|
||||
@@ -41,7 +41,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(ZoiteChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>checksum.def</ModuleDefinitionFile>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
shared_module('checksum', 'checksum.c',
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep],
|
||||
dependencies: [libgio_dep, zoitechat_plugin_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
|
||||
Reference in New Issue
Block a user