1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 03:56:45 +02:00

autosave every 60 seconds

This commit is contained in:
Jfreegman
2014-07-08 14:46:50 -04:00
parent 442f68cd31
commit 5b9fd70f30
2 changed files with 17 additions and 7 deletions

View File

@ -46,6 +46,12 @@ uint64_t get_unix_time(void)
return current_unix_time;
}
/* Returns 1 if connection has timed out, 0 otherwise */
int timed_out(uint64_t timestamp, uint64_t curtime, uint64_t timeout)
{
return timestamp + timeout <= curtime;
}
/* Get the current local time */
struct tm *get_time(void)
{
@ -135,12 +141,6 @@ int wcs_to_mbs_buf(char *buf, const wchar_t *string, size_t n)
return len;
}
/* Returns 1 if connection has timed out, 0 otherwise */
int timed_out(uint64_t timestamp, uint64_t curtime, uint64_t timeout)
{
return timestamp + timeout <= curtime;
}
/* Colours the window tab according to type. Beeps if is_beep is true */
void alert_window(ToxWindow *self, int type, bool is_beep)
{