1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/modules/irc/Common.cpp
Sandu Liviu Catalin f4a11ef825 Separated major non mandatory libraries into their onwn modules.
Consolidated and simplified the module API system.
Various other fixes and improvements.
2016-02-27 11:57:10 +02:00

34 lines
1.2 KiB
C++

// ------------------------------------------------------------------------------------------------
#include "Common.hpp"
#include "Module.hpp"
// ------------------------------------------------------------------------------------------------
#include <libircclient.h>
#include <libirc_rfcnumeric.h>
// ------------------------------------------------------------------------------------------------
static SQChar g_Buffer[512];
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
CSStr GetNick(CSStr origin)
{
// Attempt to retrieve the nickname
irc_target_get_nick(origin, g_Buffer, sizeof(g_Buffer));
// Return the nickname that could be retrieved
return g_Buffer;
}
// ------------------------------------------------------------------------------------------------
CSStr GetHost(CSStr target)
{
// Attempt to retrieve the host
irc_target_get_host(target, g_Buffer, sizeof(g_Buffer));
// Return the host that could be retrieved
return g_Buffer;
}
} // Namespace:: SqMod