remove old sasl plugin
This commit is contained in:
		
							parent
							
								
									285ddd0b60
								
							
						
					
					
						commit
						ed786843de
					
				
					 8 changed files with 0 additions and 593 deletions
				
			
		| 
						 | 
				
			
			@ -1,8 +0,0 @@
 | 
			
		|||
libdir = $(hexchatlibdir)/plugins
 | 
			
		||||
 | 
			
		||||
lib_LTLIBRARIES = sasl.la
 | 
			
		||||
sasl_la_SOURCES = sasl.c
 | 
			
		||||
sasl_la_LDFLAGS = -avoid-version -module 
 | 
			
		||||
sasl_la_LIBADD = 
 | 
			
		||||
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(srcdir)/../../src/common
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1,109 +0,0 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
			
		||||
  <ItemGroup Label="ProjectConfigurations">
 | 
			
		||||
    <ProjectConfiguration Include="Release|Win32">
 | 
			
		||||
      <Configuration>Release</Configuration>
 | 
			
		||||
      <Platform>Win32</Platform>
 | 
			
		||||
    </ProjectConfiguration>
 | 
			
		||||
    <ProjectConfiguration Include="Release|x64">
 | 
			
		||||
      <Configuration>Release</Configuration>
 | 
			
		||||
      <Platform>x64</Platform>
 | 
			
		||||
    </ProjectConfiguration>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <PropertyGroup Label="Globals">
 | 
			
		||||
    <ProjectGuid>{18871EBA-AC85-4652-8919-EB8064B9A714}</ProjectGuid>
 | 
			
		||||
    <Keyword>Win32Proj</Keyword>
 | 
			
		||||
    <RootNamespace>sasl</RootNamespace>
 | 
			
		||||
    <ProjectName>sasl</ProjectName>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 | 
			
		||||
    <ConfigurationType>DynamicLibrary</ConfigurationType>
 | 
			
		||||
    <UseDebugLibraries>false</UseDebugLibraries>
 | 
			
		||||
    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
			
		||||
    <CharacterSet>MultiByte</CharacterSet>
 | 
			
		||||
    <PlatformToolset>WDK7</PlatformToolset>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 | 
			
		||||
    <ConfigurationType>DynamicLibrary</ConfigurationType>
 | 
			
		||||
    <UseDebugLibraries>false</UseDebugLibraries>
 | 
			
		||||
    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
			
		||||
    <CharacterSet>MultiByte</CharacterSet>
 | 
			
		||||
    <PlatformToolset>WDK7</PlatformToolset>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 | 
			
		||||
  <ImportGroup Label="ExtensionSettings">
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
			
		||||
    <Import Project="..\..\win32\hexchat-xp.props" />
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 | 
			
		||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
			
		||||
    <Import Project="..\..\win32\hexchat-xp.props" />
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <PropertyGroup Label="UserMacros" />
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <LinkIncremental>false</LinkIncremental>
 | 
			
		||||
    <TargetName>hcsasl</TargetName>
 | 
			
		||||
    <OutDir>$(HexChatBin)</OutDir>
 | 
			
		||||
    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <LinkIncremental>false</LinkIncremental>
 | 
			
		||||
    <TargetName>hcsasl</TargetName>
 | 
			
		||||
    <OutDir>$(HexChatBin)</OutDir>
 | 
			
		||||
    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <ClCompile>
 | 
			
		||||
      <PrecompiledHeader>
 | 
			
		||||
      </PrecompiledHeader>
 | 
			
		||||
      <Optimization>MaxSpeed</Optimization>
 | 
			
		||||
      <FunctionLevelLinking>true</FunctionLevelLinking>
 | 
			
		||||
      <IntrinsicFunctions>true</IntrinsicFunctions>
 | 
			
		||||
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SASL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
			
		||||
      <AdditionalIncludeDirectories>$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 | 
			
		||||
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
    <Link>
 | 
			
		||||
      <SubSystem>Windows</SubSystem>
 | 
			
		||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
			
		||||
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 | 
			
		||||
      <OptimizeReferences>true</OptimizeReferences>
 | 
			
		||||
      <ModuleDefinitionFile>sasl.def</ModuleDefinitionFile>
 | 
			
		||||
      <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
 | 
			
		||||
      <AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
 | 
			
		||||
    </Link>
 | 
			
		||||
  </ItemDefinitionGroup>
 | 
			
		||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <ClCompile>
 | 
			
		||||
      <PrecompiledHeader>
 | 
			
		||||
      </PrecompiledHeader>
 | 
			
		||||
      <Optimization>MaxSpeed</Optimization>
 | 
			
		||||
      <FunctionLevelLinking>true</FunctionLevelLinking>
 | 
			
		||||
      <IntrinsicFunctions>true</IntrinsicFunctions>
 | 
			
		||||
      <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;SASL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
			
		||||
      <AdditionalIncludeDirectories>$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 | 
			
		||||
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
    <Link>
 | 
			
		||||
      <SubSystem>Windows</SubSystem>
 | 
			
		||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
			
		||||
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 | 
			
		||||
      <OptimizeReferences>true</OptimizeReferences>
 | 
			
		||||
      <ModuleDefinitionFile>sasl.def</ModuleDefinitionFile>
 | 
			
		||||
      <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
 | 
			
		||||
      <AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
 | 
			
		||||
    </Link>
 | 
			
		||||
  </ItemDefinitionGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="sasl.def" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClCompile Include="sasl.c" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 | 
			
		||||
  <ImportGroup Label="ExtensionTargets">
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
</Project>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,23 +0,0 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <Filter Include="Source Files">
 | 
			
		||||
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
 | 
			
		||||
      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
 | 
			
		||||
    </Filter>
 | 
			
		||||
    <Filter Include="Resource Files">
 | 
			
		||||
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
 | 
			
		||||
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
 | 
			
		||||
    </Filter>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="sasl.def">
 | 
			
		||||
      <Filter>Resource Files</Filter>
 | 
			
		||||
    </None>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClCompile Include="sasl.c">
 | 
			
		||||
      <Filter>Source Files</Filter>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
</Project>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,315 +0,0 @@
 | 
			
		|||
/* HexChat
 | 
			
		||||
 * Copyright (c) 2010 <ygrek@autistici.org>
 | 
			
		||||
 * Copyright (c) 2012 Berke Viktor.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
			
		||||
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * SASL authentication plugin for HexChat
 | 
			
		||||
 * Extremely primitive: only PLAIN, no error checking
 | 
			
		||||
 *
 | 
			
		||||
 * http://ygrek.org.ua/p/cap_sasl.html
 | 
			
		||||
 *
 | 
			
		||||
 * Docs:
 | 
			
		||||
 *  http://hg.atheme.org/charybdis/charybdis/file/6144f52a119b/doc/sasl.txt
 | 
			
		||||
 *  http://tools.ietf.org/html/rfc4422
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <glib.h>
 | 
			
		||||
 | 
			
		||||
#include "hexchat-plugin.h"
 | 
			
		||||
 | 
			
		||||
static hexchat_plugin *ph;   /* plugin handle */
 | 
			
		||||
static char name[] = "SASL";
 | 
			
		||||
static char desc[] = "SASL authentication plugin for HexChat";
 | 
			
		||||
static char version[] = "1.2";
 | 
			
		||||
static const char sasl_help[] = "SASL Usage:\n /SASL ADD <login> <password> <network>, enable/update SASL authentication for given network\n /SASL DEL <network>, disable SASL authentication for given network\n /SASL LIST, get the list of SASL-enabled networks\n";
 | 
			
		||||
 | 
			
		||||
struct sasl_info
 | 
			
		||||
{
 | 
			
		||||
	char const* login;
 | 
			
		||||
	char const* password;
 | 
			
		||||
	char const* network;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct sasl_info sasl_info;
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
add_info (char const* login, char const* password, char const* network)
 | 
			
		||||
{
 | 
			
		||||
	char buffer[512];
 | 
			
		||||
 | 
			
		||||
	sprintf (buffer, "%s:%s", login, password);
 | 
			
		||||
	return hexchat_pluginpref_set_str (ph, network, buffer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
del_info (char const* network)
 | 
			
		||||
{
 | 
			
		||||
	return hexchat_pluginpref_delete (ph, network);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
print_info ()
 | 
			
		||||
{
 | 
			
		||||
	char list[512];
 | 
			
		||||
	char* token;
 | 
			
		||||
 | 
			
		||||
	if (hexchat_pluginpref_list (ph, list))
 | 
			
		||||
	{
 | 
			
		||||
		hexchat_printf (ph, "%s\tSASL-enabled networks:", name);
 | 
			
		||||
		hexchat_printf (ph, "%s\t----------------------", name);
 | 
			
		||||
		token = strtok (list, ",");
 | 
			
		||||
		while (token != NULL)
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s\t%s", name, token);
 | 
			
		||||
			token = strtok (NULL, ",");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		hexchat_printf (ph, "%s\tThere are no SASL-enabled networks currently", name);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static sasl_info*
 | 
			
		||||
find_info (char const* network)
 | 
			
		||||
{
 | 
			
		||||
	char buffer[512];
 | 
			
		||||
	char* token;
 | 
			
		||||
	sasl_info* cur = (sasl_info*) malloc (sizeof (sasl_info));
 | 
			
		||||
 | 
			
		||||
	if (hexchat_pluginpref_get_str (ph, network, buffer))
 | 
			
		||||
	{
 | 
			
		||||
		token = strtok (buffer, ":");
 | 
			
		||||
		cur->login = g_strdup (token);
 | 
			
		||||
		token = strtok (NULL, ":");
 | 
			
		||||
		cur->password = g_strdup (token);
 | 
			
		||||
		cur->network = g_strdup (network);
 | 
			
		||||
 | 
			
		||||
		return cur;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static sasl_info*
 | 
			
		||||
get_info (void)
 | 
			
		||||
{
 | 
			
		||||
	const char* name;
 | 
			
		||||
	name = hexchat_get_info (ph, "network");
 | 
			
		||||
 | 
			
		||||
	if (name)
 | 
			
		||||
	{
 | 
			
		||||
		return find_info (name);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
authend_cb (char *word[], char *word_eol[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	if (get_info ())
 | 
			
		||||
	{
 | 
			
		||||
		/* omit cryptic server message parts */
 | 
			
		||||
		hexchat_printf (ph, "%s\t%s\n", name, ++word_eol[4]);
 | 
			
		||||
		hexchat_commandf (ph, "QUOTE CAP END");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return HEXCHAT_EAT_ALL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
static int
 | 
			
		||||
disconnect_cb (char *word[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	hexchat_printf (ph, "disconnected\n");
 | 
			
		||||
	return HEXCHAT_EAT_NONE;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
server_cb (char *word[], char *word_eol[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	size_t len;
 | 
			
		||||
	char* buf;
 | 
			
		||||
	char* enc;
 | 
			
		||||
	sasl_info* p;
 | 
			
		||||
 | 
			
		||||
	if (strcmp ("AUTHENTICATE", word[1]) == 0 && strcmp ("+", word[2]) == 0)
 | 
			
		||||
	{
 | 
			
		||||
		p = get_info ();
 | 
			
		||||
 | 
			
		||||
		if (!p)
 | 
			
		||||
		{
 | 
			
		||||
			return HEXCHAT_EAT_NONE;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		hexchat_printf (ph, "%s\tAuthenticating as %s\n", name, p->login);
 | 
			
		||||
 | 
			
		||||
		len = strlen (p->login) * 2 + 2 + strlen (p->password);
 | 
			
		||||
		buf = (char*) malloc (len + 1);
 | 
			
		||||
		strcpy (buf, p->login);
 | 
			
		||||
		strcpy (buf + strlen (p->login) + 1, p->login);
 | 
			
		||||
		strcpy (buf + strlen (p->login) * 2 + 2, p->password);
 | 
			
		||||
		enc = g_base64_encode ((unsigned char*) buf, len);
 | 
			
		||||
 | 
			
		||||
		/* hexchat_printf (ph, "AUTHENTICATE %s\}", enc); */
 | 
			
		||||
		hexchat_commandf (ph, "QUOTE AUTHENTICATE %s", enc);
 | 
			
		||||
 | 
			
		||||
		free (enc);
 | 
			
		||||
		free (buf);
 | 
			
		||||
 | 
			
		||||
		return HEXCHAT_EAT_ALL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return HEXCHAT_EAT_NONE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
cap_cb (char *word[], char *word_eol[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	if (get_info ())
 | 
			
		||||
	{
 | 
			
		||||
		/* FIXME test sasl cap */
 | 
			
		||||
		/* this is visible in the rawlog in case someone needs it, otherwise it's just noise */
 | 
			
		||||
		/* hexchat_printf (ph, "%s\t%s\n", name, word_eol[1]); */
 | 
			
		||||
		hexchat_commandf (ph, "QUOTE AUTHENTICATE PLAIN");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return HEXCHAT_EAT_ALL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
sasl_cmd_cb (char *word[], char *word_eol[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	const char* login;
 | 
			
		||||
	const char* password;
 | 
			
		||||
	const char* network;
 | 
			
		||||
	const char* mode = word[2];
 | 
			
		||||
 | 
			
		||||
	if (!g_ascii_strcasecmp ("ADD", mode))
 | 
			
		||||
	{
 | 
			
		||||
		login = word[3];
 | 
			
		||||
		password = word[4];
 | 
			
		||||
		network = word_eol[5];
 | 
			
		||||
 | 
			
		||||
		if (!network || !*network)	/* only check for the last word, if it's there, the previous ones will be there, too */
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s", sasl_help);
 | 
			
		||||
			return HEXCHAT_EAT_ALL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (add_info (login, password, network))
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s\tEnabled SASL authentication for the \"%s\" network\n", name, network);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s\tFailed to enable SASL authentication for the \"%s\" network\n", name, network);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return HEXCHAT_EAT_ALL;
 | 
			
		||||
	}
 | 
			
		||||
	else if (!g_ascii_strcasecmp ("DEL", mode))
 | 
			
		||||
	{
 | 
			
		||||
		network = word_eol[3];
 | 
			
		||||
 | 
			
		||||
		if (!network || !*network)
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s", sasl_help);
 | 
			
		||||
			return HEXCHAT_EAT_ALL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (del_info (network))
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s\tDisabled SASL authentication for the \"%s\" network\n", name, network);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			hexchat_printf (ph, "%s\tFailed to disable SASL authentication for the \"%s\" network\n", name, network);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return HEXCHAT_EAT_ALL;
 | 
			
		||||
	}
 | 
			
		||||
	else if (!g_ascii_strcasecmp ("LIST", mode))
 | 
			
		||||
	{
 | 
			
		||||
		print_info ();
 | 
			
		||||
		return HEXCHAT_EAT_ALL;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		hexchat_printf (ph, "%s", sasl_help);
 | 
			
		||||
		return HEXCHAT_EAT_ALL;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
connect_cb (char *word[], void *userdata)
 | 
			
		||||
{
 | 
			
		||||
	if (get_info ())
 | 
			
		||||
	{
 | 
			
		||||
		hexchat_printf (ph, "%s\tSASL enabled\n", name);
 | 
			
		||||
		hexchat_commandf (ph, "QUOTE CAP REQ :sasl");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return HEXCHAT_EAT_NONE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
 | 
			
		||||
{
 | 
			
		||||
	/* we need to save this for use with any hexchat_* functions */
 | 
			
		||||
	ph = plugin_handle;
 | 
			
		||||
 | 
			
		||||
	/* tell HexChat our info */
 | 
			
		||||
	*plugin_name = name;
 | 
			
		||||
	*plugin_desc = desc;
 | 
			
		||||
	*plugin_version = version;
 | 
			
		||||
 | 
			
		||||
	hexchat_hook_command (ph, "SASL", HEXCHAT_PRI_NORM, sasl_cmd_cb, sasl_help, 0);
 | 
			
		||||
	hexchat_hook_print (ph, "Connected", HEXCHAT_PRI_NORM, connect_cb, NULL);
 | 
			
		||||
	/* hexchat_hook_print (ph, "Disconnected", HEXCHAT_PRI_NORM, disconnect_cb, NULL); */
 | 
			
		||||
	hexchat_hook_server (ph, "CAP", HEXCHAT_PRI_NORM, cap_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "RAW LINE", HEXCHAT_PRI_NORM, server_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "903", HEXCHAT_PRI_NORM, authend_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "904", HEXCHAT_PRI_NORM, authend_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "905", HEXCHAT_PRI_NORM, authend_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "906", HEXCHAT_PRI_NORM, authend_cb, NULL);
 | 
			
		||||
	hexchat_hook_server (ph, "907", HEXCHAT_PRI_NORM, authend_cb, NULL);
 | 
			
		||||
 | 
			
		||||
	hexchat_printf (ph, "%s plugin loaded\n", name);
 | 
			
		||||
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
hexchat_plugin_deinit (void)
 | 
			
		||||
{
 | 
			
		||||
	hexchat_printf (ph, "%s plugin unloaded\n", name);
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
EXPORTS 
 | 
			
		||||
hexchat_plugin_init 
 | 
			
		||||
hexchat_plugin_deinit 
 | 
			
		||||
| 
						 | 
				
			
			@ -1,106 +0,0 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
			
		||||
  <ItemGroup Label="ProjectConfigurations">
 | 
			
		||||
    <ProjectConfiguration Include="Release|Win32">
 | 
			
		||||
      <Configuration>Release</Configuration>
 | 
			
		||||
      <Platform>Win32</Platform>
 | 
			
		||||
    </ProjectConfiguration>
 | 
			
		||||
    <ProjectConfiguration Include="Release|x64">
 | 
			
		||||
      <Configuration>Release</Configuration>
 | 
			
		||||
      <Platform>x64</Platform>
 | 
			
		||||
    </ProjectConfiguration>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <PropertyGroup Label="Globals">
 | 
			
		||||
    <ProjectGuid>{18871EBA-AC85-4652-8919-EB8064B9A714}</ProjectGuid>
 | 
			
		||||
    <Keyword>Win32Proj</Keyword>
 | 
			
		||||
    <RootNamespace>sasl</RootNamespace>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 | 
			
		||||
    <ConfigurationType>DynamicLibrary</ConfigurationType>
 | 
			
		||||
    <UseDebugLibraries>false</UseDebugLibraries>
 | 
			
		||||
    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
			
		||||
    <CharacterSet>MultiByte</CharacterSet>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 | 
			
		||||
    <ConfigurationType>DynamicLibrary</ConfigurationType>
 | 
			
		||||
    <UseDebugLibraries>false</UseDebugLibraries>
 | 
			
		||||
    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
			
		||||
    <CharacterSet>MultiByte</CharacterSet>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 | 
			
		||||
  <ImportGroup Label="ExtensionSettings">
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
			
		||||
    <Import Project="..\..\win32\hexchat.props" />
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 | 
			
		||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
			
		||||
    <Import Project="..\..\win32\hexchat.props" />
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
  <PropertyGroup Label="UserMacros" />
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <LinkIncremental>false</LinkIncremental>
 | 
			
		||||
    <TargetName>hcsasl</TargetName>
 | 
			
		||||
    <OutDir>$(HexChatBin)</OutDir>
 | 
			
		||||
    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <LinkIncremental>false</LinkIncremental>
 | 
			
		||||
    <TargetName>hcsasl</TargetName>
 | 
			
		||||
    <OutDir>$(HexChatBin)</OutDir>
 | 
			
		||||
    <IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
			
		||||
    <ClCompile>
 | 
			
		||||
      <PrecompiledHeader>
 | 
			
		||||
      </PrecompiledHeader>
 | 
			
		||||
      <Optimization>MaxSpeed</Optimization>
 | 
			
		||||
      <FunctionLevelLinking>true</FunctionLevelLinking>
 | 
			
		||||
      <IntrinsicFunctions>true</IntrinsicFunctions>
 | 
			
		||||
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SASL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
			
		||||
      <AdditionalIncludeDirectories>$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 | 
			
		||||
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
    <Link>
 | 
			
		||||
      <SubSystem>Windows</SubSystem>
 | 
			
		||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
			
		||||
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 | 
			
		||||
      <OptimizeReferences>true</OptimizeReferences>
 | 
			
		||||
      <ModuleDefinitionFile>sasl.def</ModuleDefinitionFile>
 | 
			
		||||
      <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
 | 
			
		||||
      <AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
 | 
			
		||||
    </Link>
 | 
			
		||||
  </ItemDefinitionGroup>
 | 
			
		||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <ClCompile>
 | 
			
		||||
      <PrecompiledHeader>
 | 
			
		||||
      </PrecompiledHeader>
 | 
			
		||||
      <Optimization>MaxSpeed</Optimization>
 | 
			
		||||
      <FunctionLevelLinking>true</FunctionLevelLinking>
 | 
			
		||||
      <IntrinsicFunctions>true</IntrinsicFunctions>
 | 
			
		||||
      <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;SASL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
			
		||||
      <AdditionalIncludeDirectories>$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 | 
			
		||||
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
    <Link>
 | 
			
		||||
      <SubSystem>Windows</SubSystem>
 | 
			
		||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
			
		||||
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 | 
			
		||||
      <OptimizeReferences>true</OptimizeReferences>
 | 
			
		||||
      <ModuleDefinitionFile>sasl.def</ModuleDefinitionFile>
 | 
			
		||||
      <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
 | 
			
		||||
      <AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
 | 
			
		||||
    </Link>
 | 
			
		||||
  </ItemDefinitionGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="sasl.def" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClCompile Include="sasl.c" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 | 
			
		||||
  <ImportGroup Label="ExtensionTargets">
 | 
			
		||||
  </ImportGroup>
 | 
			
		||||
</Project>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,23 +0,0 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <Filter Include="Source Files">
 | 
			
		||||
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
 | 
			
		||||
      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
 | 
			
		||||
    </Filter>
 | 
			
		||||
    <Filter Include="Resource Files">
 | 
			
		||||
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
 | 
			
		||||
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
 | 
			
		||||
    </Filter>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <None Include="sasl.def">
 | 
			
		||||
      <Filter>Resource Files</Filter>
 | 
			
		||||
    </None>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ClCompile Include="sasl.c">
 | 
			
		||||
      <Filter>Source Files</Filter>
 | 
			
		||||
    </ClCompile>
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
</Project>
 | 
			
		||||
| 
						 | 
				
			
			@ -63,8 +63,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "..\plugins\winamp
 | 
			
		|||
EndProject
 | 
			
		||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sysinfo", "..\plugins\sysinfo\sysinfo.vcxproj", "{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sasl", "..\plugins\sasl\sasl.vcxproj", "{18871EBA-AC85-4652-8919-EB8064B9A714}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hextray", "..\plugins\hextray\hextray.vcxproj", "{3024CF36-85E5-4E00-9608-7002E2C7EF14}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wmpa", "..\plugins\wmpa\wmpa.vcxproj", "{E7F4DB0A-510D-41EF-B284-6E1DE1CC450D}"
 | 
			
		||||
| 
						 | 
				
			
			@ -91,7 +89,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy", "copy\copy.vcxproj",
 | 
			
		|||
		{3786FA8C-3E76-45E3-984E-FCCFF44729C9} = {3786FA8C-3E76-45E3-984E-FCCFF44729C9}
 | 
			
		||||
		{B0E36D93-CA2A-49FE-9EB9-9C96C6016EEC} = {B0E36D93-CA2A-49FE-9EB9-9C96C6016EEC}
 | 
			
		||||
		{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}
 | 
			
		||||
		{18871EBA-AC85-4652-8919-EB8064B9A714} = {18871EBA-AC85-4652-8919-EB8064B9A714}
 | 
			
		||||
		{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82} = {E4BDB4C8-2335-415A-ACEE-BA88B19BFE82}
 | 
			
		||||
		{DE87FFCA-9606-4116-B747-062D88A56A28} = {DE87FFCA-9606-4116-B747-062D88A56A28}
 | 
			
		||||
		{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E} = {3C4F42FC-292A-420B-B63D-C03DFBDD8E4E}
 | 
			
		||||
| 
						 | 
				
			
			@ -184,8 +181,6 @@ Global
 | 
			
		|||
		{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|Win32.Build.0 = Release|Win32
 | 
			
		||||
		{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.ActiveCfg = Release|x64
 | 
			
		||||
		{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.Build.0 = Release|x64
 | 
			
		||||
		{18871EBA-AC85-4652-8919-EB8064B9A714}.Release|Win32.ActiveCfg = Release|Win32
 | 
			
		||||
		{18871EBA-AC85-4652-8919-EB8064B9A714}.Release|x64.ActiveCfg = Release|x64
 | 
			
		||||
		{3024CF36-85E5-4E00-9608-7002E2C7EF14}.Release|Win32.ActiveCfg = Release|Win32
 | 
			
		||||
		{3024CF36-85E5-4E00-9608-7002E2C7EF14}.Release|Win32.Build.0 = Release|Win32
 | 
			
		||||
		{3024CF36-85E5-4E00-9608-7002E2C7EF14}.Release|x64.ActiveCfg = Release|x64
 | 
			
		||||
| 
						 | 
				
			
			@ -235,7 +230,6 @@ Global
 | 
			
		|||
		{461DC24A-A410-4171-8C02-CCDBF3702C2A} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{18871EBA-AC85-4652-8919-EB8064B9A714} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{3024CF36-85E5-4E00-9608-7002E2C7EF14} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{E7F4DB0A-510D-41EF-B284-6E1DE1CC450D} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
 | 
			
		||||
		{2773666A-8CFC-4533-A043-EAD59F16A1C7} = {D237DA6B-BD5F-46C0-8BEA-50E9A1340240}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue