Commit 31d9f608 authored by stettberger's avatar stettberger

* Added /chaninfo [topic/mode]

parent efbb9d62
......@@ -315,19 +315,54 @@ void proc_channels_input(Channel *c, char *buf) {
print_out("", "-!?- The master channel is not a real channel");
}
else {
print_out("", "-!?- Name: %s", c->silc->channel_name);
print_out("", "-!?- Topic: %s", c->silc->topic?c->silc->topic:"None");
if ( strlen(&buf[9]) > 2) {
if (!strncmp(&buf[10], "topic", 5)) {
print_out(c->silc->channel_name, "-?!- Topic: %s",
c->silc->topic?c->silc->topic:"None");
}
else if (!strncmp(&buf[10], "mode", 4)) {
char *str;
str = silc_client_chmode(c->silc->mode,
c->silc->channel_key ?
silc_cipher_get_name(c->silc->channel_key) : "",
c->silc->hmac ?
silc_hmac_get_name(c->silc->hmac) : "");
print_out(c->silc->channel_name, "-?!- Channel Mode: %s",
str?str:"None");
free(str);
}
else
print_out(c->silc->channel_name,
"-!- Error: /chaninfo [<topic/mode>]");
}
else {
char *str;
str = silc_client_chmode(c->silc->mode,
c->silc->channel_key ?
silc_cipher_get_name(c->silc->channel_key) : "",
c->silc->hmac ?
silc_hmac_get_name(c->silc->hmac) : "");
print_out(c->silc->channel_name, "-?!- Name: %s",
c->silc->channel_name);
print_out(c->silc->channel_name, "-?!- Topic: %s",
c->silc->topic?c->silc->topic:"None");
print_out(c->silc->channel_name, "-?!- Channel Mode: %s",
str?str:"None");
free(str);
}
}
}
/* Leave */
else if (buf[1]=='l' && ( buf[2] == ' ' || strlen(buf)==2)) {
DEBUG("Input: LEAVE");
if ( buf[2] == ' ') {
silc_client_command_call(silc_client->client, silc_client->conn, NULL, "LEAVE", &buf[3], NULL);
silc_client_command_call(silc_client->client, silc_client->conn, NULL,
"LEAVE", &buf[3], NULL);
}
else if(strlen(buf)==2)
if (strlen(c->silc->channel_name)!=0) {
silc_client_command_call(silc_client->client, silc_client->conn, NULL, "LEAVE", c->silc->channel_name, NULL);
silc_client_command_call(silc_client->client, silc_client->conn,
NULL, "LEAVE", c->silc->channel_name, NULL);
}
}
else if ((buf[1]== 'n' && buf[2]==' ') || !strcmp(&buf[1], "nick")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment