1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00
SqMod/modules/irc/Common.cpp

34 lines
1.2 KiB
C++
Raw Normal View History

// ------------------------------------------------------------------------------------------------
#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