X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_attrs.c;fp=lib%2Fsilcclient%2Fclient_attrs.c;h=a7825270e4e450cd242f64b53def19c311a6d008;hb=b9fde2a2a32801d3eecba020927c94cb4838de72;hp=8f131559bffbb4ce0450e98ab8bf37de1ad6d207;hpb=876c547d58872e8c60e929e39ecf40b35e7e2b83;p=silc.git diff --git a/lib/silcclient/client_attrs.c b/lib/silcclient/client_attrs.c index 8f131559..a7825270 100644 --- a/lib/silcclient/client_attrs.c +++ b/lib/silcclient/client_attrs.c @@ -35,6 +35,7 @@ static void silc_client_attributes_process_foreach(void *key, void *context, SilcAttributePayload attr = context; SilcAttrForeach *f = user_context; const unsigned char *data; + unsigned char tmp[32]; SilcUInt32 data_len; if (!context) { @@ -54,17 +55,17 @@ static void silc_client_attributes_process_foreach(void *key, void *context, SILC_LOG_DEBUG(("Attribute %d found", attribute)); data = silc_attribute_get_data(attr, &data_len); -#if 0 /* We replace the TIMEZONE with valid value here */ if (attribute == SILC_ATTRIBUTE_TIMEZONE) { - data = (const unsigned char *)silc_get_time(0); - data_len = strlen(data); - f->buffer = silc_attribute_payload_encode(f->buffer, attribute, - SILC_ATTRIBUTE_FLAG_VALID, - (void *)data, data_len); + if (silc_timezone(tmp, sizeof(tmp))) { + data = tmp; + data_len = strlen(tmp); + f->buffer = silc_attribute_payload_encode(f->buffer, attribute, + SILC_ATTRIBUTE_FLAG_VALID, + (void *)data, data_len); + } return; } -#endif f->buffer = silc_attribute_payload_encode_data(f->buffer, attribute, SILC_ATTRIBUTE_FLAG_VALID, @@ -89,8 +90,10 @@ SilcBuffer silc_client_attributes_process(SilcClient client, /* If nothing is set by application assume that we don't want to use attributes, ignore the request. */ - if (!conn->internal->attrs) + if (!conn->internal->attrs) { + SILC_LOG_DEBUG(("User has not set any attributes")); return NULL; + } /* Always put our public key. */ pk.type = "silc-rsa";