/* Update statistics */
if (mask & SILC_UMODE_GONE) {
- if (!client->mode & SILC_UMODE_GONE)
+ if (!(client->mode & SILC_UMODE_GONE))
server->stat.my_aways++;
} else {
if (client->mode & SILC_UMODE_GONE)
server->stat.my_aways--;
}
- if (mask & SILC_UMODE_DETACHED) {
- if (!client->mode & SILC_UMODE_DETACHED)
- server->stat.my_detached++;
- } else {
- if (client->mode & SILC_UMODE_DETACHED)
- server->stat.my_detached--;
- }
/* Change the mode */
client->mode = mask;
silc_server_send_notify_umode(server, server->router->connection,
server->server_type == SILC_SERVER ?
FALSE : TRUE, client->id, client->mode);
+ server->stat.my_detached++;
/* Check if anyone is watching this nickname */
if (server->server_type == SILC_ROUTER)
/* Update statistics */
if (server->server_type == SILC_ROUTER) {
if (mode & SILC_UMODE_GONE) {
- if (!client->mode & SILC_UMODE_GONE)
+ if (!(client->mode & SILC_UMODE_GONE))
server->stat.aways++;
} else {
if (client->mode & SILC_UMODE_GONE)
server->stat.aways--;
}
if (mode & SILC_UMODE_DETACHED) {
- if (!client->mode & SILC_UMODE_DETACHED)
+ if (!(client->mode & SILC_UMODE_DETACHED))
server->stat.detached++;
} else {
if (client->mode & SILC_UMODE_DETACHED)
detached_client->data.status |= SILC_IDLIST_STATUS_REGISTERED;
detached_client->data.status |= SILC_IDLIST_STATUS_RESUMED;
detached_client->mode &= ~SILC_UMODE_DETACHED;
+ server->stat.my_detached--;
/* Send the RESUME_CLIENT packet to our primary router so that others
know this client isn't detached anymore. */