Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 991:ef10906691bb
Chatstates: add composing timeout
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 01 Nov 2006 11:56:58 +0100 |
parents | 35e7913affb7 |
children | b37348c2aa79 |
comparison
equal
deleted
inserted
replaced
990:35e7913affb7 | 991:ef10906691bb |
---|---|
168 | 168 |
169 void jb_main() | 169 void jb_main() |
170 { | 170 { |
171 time_t now; | 171 time_t now; |
172 fd_set fds; | 172 fd_set fds; |
173 long autoaway_timeout; | 173 long timeout; |
174 struct timeval tv; | 174 struct timeval tv; |
175 static time_t last_eviqs_check = 0; | 175 static time_t last_eviqs_check = 0; |
176 | 176 |
177 if (!online) { | 177 if (!online) { |
178 safe_usleep(10000); | 178 safe_usleep(10000); |
200 } else { | 200 } else { |
201 tv.tv_sec = LastPingTime + (time_t)KeepaliveDelay - now; | 201 tv.tv_sec = LastPingTime + (time_t)KeepaliveDelay - now; |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 autoaway_timeout = scr_GetAutoAwayTimeout(now); | 205 // Check auto-away timeout |
206 if (tv.tv_sec > autoaway_timeout) { | 206 timeout = scr_GetAutoAwayTimeout(now); |
207 tv.tv_sec = autoaway_timeout; | 207 if (tv.tv_sec > timeout) { |
208 } | 208 tv.tv_sec = timeout; |
209 } | |
210 | |
211 #if defined JEP0022 || defined JEP0085 | |
212 // Check composing timeout | |
213 timeout = scr_GetChatStatesTimeout(now); | |
214 if (tv.tv_sec > timeout) { | |
215 tv.tv_sec = timeout; | |
216 } | |
217 #endif | |
209 | 218 |
210 if (!tv.tv_sec) | 219 if (!tv.tv_sec) |
211 tv.tv_usec = 350000; | 220 tv.tv_usec = 350000; |
212 | 221 |
213 scr_DoUpdate(); | 222 scr_DoUpdate(); |