snprintf(message, sizeof(message), "%s (%s) has joined channel %s",
client_entry->nickname, client_entry->username,
channel_entry->channel_name);
+ if (client_entry == conn->local_entry) {
+ SilcChannelUser chu;
+
+ silc_list_start(channel_entry->clients);
+ while ((chu = silc_list_get(channel_entry->clients)) != SILC_LIST_END) {
+ if (chu->client == client_entry) {
+ if (app->screen->bottom_line->mode)
+ silc_free(app->screen->bottom_line->mode);
+ app->screen->bottom_line->mode = silc_client_chumode_char(chu->mode);
+ silc_screen_print_bottom_line(app->screen, 0);
+ break;
+ }
+ }
+ }
break;
case SILC_NOTIFY_TYPE_LEAVE:
{
char buf[1024], *nickname, *username, *realname;
int len;
- unsigned int idle;
+ unsigned int idle, mode;
+ SilcBuffer channels;
if (status == SILC_STATUS_ERR_NO_SUCH_NICK) {
char *tmp;
nickname = va_arg(vp, char *);
username = va_arg(vp, char *);
realname = va_arg(vp, char *);
- (void)va_arg(vp, void *);
+ channels = va_arg(vp, SilcBuffer);
+ mode = va_arg(vp, unsigned int);
idle = va_arg(vp, unsigned int);
memset(buf, 0, sizeof(buf));
}
client->ops->say(client, conn, "%s", buf);
+
+ if (channels) {
+ SilcDList list = silc_channel_payload_parse_list(channels);
+ if (list) {
+ SilcChannelPayload entry;
+
+ memset(buf, 0, sizeof(buf));
+ strcat(buf, "on channels: ");
+
+ silc_dlist_start(list);
+ while ((entry = silc_dlist_get(list)) != SILC_LIST_END) {
+ char *m = silc_client_chumode_char(silc_channel_get_mode(entry));
+ unsigned int name_len;
+ char *name = silc_channel_get_name(entry, &name_len);
+
+ if (m)
+ strncat(buf, m, strlen(m));
+ strncat(buf, name, name_len);
+ strncat(buf, " ", 1);
+ silc_free(m);
+ }
+
+ client->ops->say(client, conn, "%s", buf);
+ silc_channel_payload_list_free(list);
+ }
+ }
+
+ if (mode)
+ client->ops->say(client, conn, "%s is %s", nickname,
+ (mode & SILC_UMODE_SERVER_OPERATOR) ?
+ "Server Operator" :
+ (mode & SILC_UMODE_ROUTER_OPERATOR) ?
+ "SILC Operator" : "[Unknown mode]");
+
if (idle && nickname)
client->ops->say(client, conn, "%s has been idle %d %s",
nickname,
}
break;
+ case SILC_COMMAND_UMODE:
+ {
+ unsigned int mode;
+
+ if (!success)
+ return;
+
+ mode = va_arg(vp, unsigned int);
+
+ if (!mode && app->screen->bottom_line->umode) {
+ silc_free(app->screen->bottom_line->umode);
+ app->screen->bottom_line->umode = NULL;
+ }
+
+ if (mode & SILC_UMODE_SERVER_OPERATOR) {
+ if (app->screen->bottom_line->umode)
+ silc_free(app->screen->bottom_line->umode);
+ app->screen->bottom_line->umode = strdup("Server Operator");;
+ }
+
+ if (mode & SILC_UMODE_ROUTER_OPERATOR) {
+ if (app->screen->bottom_line->umode)
+ silc_free(app->screen->bottom_line->umode);
+ app->screen->bottom_line->umode = strdup("SILC Operator");;
+ }
+
+ silc_screen_print_bottom_line(app->screen, 0);
+ }
+ break;
+
+ case SILC_COMMAND_OPER:
+ if (status == SILC_STATUS_OK) {
+ conn->local_entry->mode |= SILC_UMODE_SERVER_OPERATOR;
+ if (app->screen->bottom_line->umode)
+ silc_free(app->screen->bottom_line->umode);
+ app->screen->bottom_line->umode = strdup("Server Operator");;
+ silc_screen_print_bottom_line(app->screen, 0);
+ }
+ break;
+
+ case SILC_COMMAND_SILCOPER:
+ if (status == SILC_STATUS_OK) {
+ conn->local_entry->mode |= SILC_UMODE_ROUTER_OPERATOR;
+ if (app->screen->bottom_line->umode)
+ silc_free(app->screen->bottom_line->umode);
+ app->screen->bottom_line->umode = strdup("SILC Operator");;
+ silc_screen_print_bottom_line(app->screen, 0);
+ }
+ break;
+
case SILC_COMMAND_USERS:
if (!success)
return;
if (chu->client == conn->local_entry) {
if (app->screen->bottom_line->mode)
silc_free(app->screen->bottom_line->mode);
- app->screen->bottom_line->mode =
- silc_client_chumode_char(chu->mode);
+ app->screen->bottom_line->mode = silc_client_chumode_char(chu->mode);
silc_screen_print_bottom_line(app->screen, 0);
break;
}