rendered paste bodytime_t temp;
struct tm *tms;
hContact=find_contact(nick);
LOG("WndProc", "TIMEZONE");
LOG("WndProc", nick);
if (hContact==NULL)
{
LOG("WndProc", "No contact found");
SkypeSend("GET USER %s BUDDYSTATUS", nick);
}
else
if (atoi(ptr+9) != 0) {
temp = time(0);
tms = localtime(&temp);
if (atoi(ptr+9) >= 86400 ) timezone=256-((2*(atoi(ptr+9)-86400))/3600);
if (atoi(ptr+9) < 86400 ) timezone=((-2*(atoi(ptr+9)-86400))/3600);
if (tms->tm_isdst == 1 && DBGetContactSettingByte(NULL, pszSkypeProtoName, "UseTimeZonePatch", 0))
{
LOG("WndProc", "Using the TimeZonePatch");
DBWriteContactSettingByte(hContact, "UserInfo", "Timezone", (timezone+2));
}
else
{
LOG("WndProc", "Not using the TimeZonePatch");
DBWriteContactSettingByte(hContact, "UserInfo", "Timezone", (timezone+0));
}
}
else
{
LOG("WndProc", "Deleting the TimeZone in UserInfo Section");
DBDeleteContactSetting(hContact, "UserInfo", "Timezone");
}
free(buf);
break;