Channel implementation in demo.

This commit is contained in:
Nicolás Ortega Froysa 2017-11-17 17:18:46 +01:00
parent 909a5ff740
commit 922f66969b
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF

View File

@ -69,6 +69,21 @@ int main(int argc, char *argv[]) {
statistics.incoming, statistics.incoming,
statistics.total); statistics.total);
} }
else if(strstr(in, "/join") == in)
{
const char *chan = strchr(in, '#');
if(!chan)
puts("No channel name detected. Channel names start with `#'.");
NeoComm_join_channel(chan);
}
else if(strstr(in, "/leave") == in)
{
const char *chan = strchr(in, '#');
if(!chan)
puts("No channel name detected. Channel names start with `#'.");
if(!NeoComm_leave_channel(chan))
printf("%s\n", NeoComm_get_last_error());
}
else if(strcmp(in, "/help") == 0) else if(strcmp(in, "/help") == 0)
print_help(); print_help();
} }