All pastes #286156 Raw Edit

Mine

public text v1 · immutable
#286156 ·published 2006-12-20 12:30 UTC
rendered paste body
time_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;