mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
f4a11ef825
Consolidated and simplified the module API system. Various other fixes and improvements.
34 lines
1.2 KiB
C++
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
|