4
Fork 0

Added filtering of local node callsign

This commit is contained in:
Artem Prilutskiy 2019-06-04 16:22:31 +03:00
parent e6561f15d1
commit cfb0c9061d
3 changed files with 22 additions and 6 deletions

View file

@ -19,9 +19,11 @@
BrandMeisterBridge::BrandMeisterBridge()
{
proxy = NULL;
handle = NULL;
talker = (char*)malloc(TALKER_BUFFER_SIZE);
proxy = NULL;
handle = NULL;
node = NULL;
length = 0;
talker = (char*)malloc(TALKER_BUFFER_SIZE);
unknown = ECHOLINK_DEFAULT_USER_NUMBER;
}
@ -30,6 +32,7 @@ BrandMeisterBridge::~BrandMeisterBridge()
iconv_close(handle);
DELETE(proxy);
free(talker);
free(node);
}
// Interface methods for ModuleEchoLink
@ -44,6 +47,12 @@ void BrandMeisterBridge::setDefaultConfiguration(const char* configuration)
unknown = strtol(configuration, NULL, 10);
}
void BrandMeisterBridge::setCallConfiguration(const char* configuration)
{
node = strdup(configuration);
length = strlen(configuration);
}
void BrandMeisterBridge::setProxyConfiguration(const char* configuration)
{
char* pointer = const_cast<char*>(configuration);
@ -115,9 +124,11 @@ void BrandMeisterBridge::handleChatMessage(const char* text)
if (strncmp(text, "CONF ", 5) == 0)
{
const char* delimiter = strstr(text, "\n->");
if (delimiter != NULL)
const char* call = delimiter + 3;
if ((delimiter != NULL) &&
((node == NULL) || (strncmp(call, node, length) != 0)))
{
const char* call = delimiter + 3;
// Don't pass local node callsign
setTalkerData(call, call);
}
else