/*
- silc-queries.c
+ silc-queries.c
Author: Pekka Riikonen <priikone@silcnet.org>
if (!strcasecmp(argv[1], "-del")) {
/* Delete attribute */
- if (!strcasecmp(argv[1], "vcard")) {
+ if (!strcasecmp(argv[2], "vcard")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_USER_INFO, NULL);
settings_set_str("attr_vcard", "");
- } else if (!strcasecmp(argv[1], "services")) {
+ } else if (!strcasecmp(argv[2], "services")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_SERVICE, NULL);
settings_set_str("attr_services", argv[2]);
- } else if (!strcasecmp(argv[1], "status_mood")) {
+ } else if (!strcasecmp(argv[2], "status_mood")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_STATUS_MOOD, NULL);
settings_set_str("attr_status_mood", "");
- } else if (!strcasecmp(argv[1], "status_text")) {
+ } else if (!strcasecmp(argv[2], "status_text")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_STATUS_FREETEXT, NULL);
settings_set_str("attr_status_text", "");
- } else if (!strcasecmp(argv[1], "status_message")) {
+ } else if (!strcasecmp(argv[2], "status_message")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_STATUS_MESSAGE, NULL);
settings_set_str("attr_status_message", "");
- } else if (!strcasecmp(argv[1], "preferred_language")) {
+ } else if (!strcasecmp(argv[2], "preferred_language")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_PREFERRED_LANGUAGE, NULL);
settings_set_str("attr_preferred_language", "");
- } else if (!strcasecmp(argv[1], "preferred_contact")) {
+ } else if (!strcasecmp(argv[2], "preferred_contact")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_PREFERRED_CONTACT, NULL);
settings_set_str("attr_preferred_contact", "");
- } else if (!strcasecmp(argv[1], "timezone")) {
+ } else if (!strcasecmp(argv[2], "timezone")) {
return;
- } else if (!strcasecmp(argv[1], "geolocation")) {
+ } else if (!strcasecmp(argv[2], "geolocation")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_GEOLOCATION, NULL);
settings_set_str("attr_geolocation", "");
- } else if (!strcasecmp(argv[1], "device_info")) {
+ } else if (!strcasecmp(argv[2], "device_info")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_DEVICE_INFO, NULL);
settings_set_str("attr_device_info", "");
- } else if (!strcasecmp(argv[1], "public_keys")) {
+ } else if (!strcasecmp(argv[2], "public_keys")) {
silc_client_attribute_del(silc_client, server->conn,
SILC_ATTRIBUTE_USER_PUBLIC_KEY, NULL);
settings_set_str("attr_public_keys", "");
tmp = strchr(*entry, ':') + 1;
if (!tmp || !(*tmp))
continue;
+ memset(&service, 0, sizeof(service));
service.port = atoi(tmp);
*strchr(*entry, ':') = '\0';
silc_strncat(service.address, sizeof(service.address), *entry,
strlen(*entry));
service.status = TRUE;
+ service.idle = 0;
silc_client_attribute_add(silc_client, conn,
SILC_ATTRIBUTE_SERVICE, &service,
sizeof(service));
mask |= SILC_ATTRIBUTE_CONTACT_MMS;
if (!strcasecmp(*entry, "CHAT"))
mask |= SILC_ATTRIBUTE_CONTACT_CHAT;
+ if (!strcasecmp(*entry, "VIDEO"))
+ mask |= SILC_ATTRIBUTE_CONTACT_VIDEO;
}
silc_client_attribute_add(silc_client, conn,
SILC_ATTRIBUTE_PREFERRED_CONTACT, (void *)mask,
if (!silc_attribute_get_object(attr, (void *)&service,
sizeof(service)))
continue;
- snprintf(tmp, sizeof(tmp) - 1, "%s:%d (logged %s)",
+ snprintf(tmp, sizeof(tmp) - 1, "%s:%d (logged %s) idle %d seconds",
service.address, (unsigned int)service.port,
- service.status ? "in" : "out");
+ service.status ? "in" : "out",
+ (unsigned int)service.idle);
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_SERVICES, tmp);
}
silc_strncat(tmp, sizeof(tmp), "SMS ", strlen(" SMS"));
if (mask & SILC_ATTRIBUTE_CONTACT_MMS)
silc_strncat(tmp, sizeof(tmp), "MMS ", strlen(" MMS"));
+ if (mask & SILC_ATTRIBUTE_CONTACT_VIDEO)
+ silc_strncat(tmp, sizeof(tmp), "VIDEO ", strlen(" VIDEO"));
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ATTR_PREFERRED_CONTACT, tmp);
}
if (verify->userpk.data) {
silc_verify_public_key(client, conn, SILC_SOCKET_TYPE_CLIENT,
- verify->userpk.data, verify->userpk.data_len,
+ verify->userpk.data, verify->userpk.data_len,
SILC_SKE_PK_TYPE_SILC,
silc_query_attributes_print_final, verify);
} else {
for (i = 0; i < strlen(fingerprint); i++)
if (fingerprint[i] == ' ')
fingerprint[i] = '_';
-
+
/* Filename for dir */
tmp = fingerprint + strlen(fingerprint) - 9;
- snprintf(filename, sizeof(filename) - 1, "%s/friends/%s",
+ snprintf(filename, sizeof(filename) - 1, "%s/friends/%s",
get_irssi_dir(), tmp);
silc_free(fingerprint);
/* Filename for dir */
tmp = fingerprint + strlen(fingerprint) - 9;
- snprintf(filename, sizeof(filename) - 1, "%s/friends/%s",
+ snprintf(filename, sizeof(filename) - 1, "%s/friends/%s",
get_irssi_dir(), tmp);
/* Create dir if it doesn't exist */
}
/* Save MIME message data */
- if (verify->extension.mime) {
+ if (verify->message.mime) {
memset(filename2, 0, sizeof(filename2));
snprintf(filename2, sizeof(filename2) - 1, "%s/status_message.mime",
filename);