- Timestamp:
- May 31, 2003, 3:33:42 PM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 5e53c4a
- Parents:
- c86a35c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
rac70242 rd09e5a1 31 31 owl_popwin *pw; 32 32 int j, ret, initialsubs, debug, argcsave, followlast; 33 int new zephyrs, zpendcount, nexttimediff;33 int newmsgs, zpendcount, nexttimediff; 34 34 struct sigaction sigact; 35 35 char *configfile, *tty, *perlout, **argvsave, buff[LINE], startupmsg[LINE]; … … 214 214 owl_function_zlog_in(); 215 215 } 216 217 /* AIM init */ 218 owl_aim_init(); 216 219 217 220 /* welcome message */ … … 264 267 265 268 /* grab incoming zephyrs */ 266 new zephyrs=0;269 newmsgs=0; 267 270 zpendcount=0; 268 while(ZPending() ) {271 while(ZPending() || owl_global_messagequeue_pending(&g)) { 269 272 ZNotice_t notice; 270 273 struct sockaddr_in from; … … 272 275 owl_filter *f; 273 276 274 /* grab a notice, but if we've done 20 without stopping, take 275 a break to process keystrokes etc. */ 276 if (zpendcount>20) break; 277 ZReceiveNotice(¬ice, &from); 278 zpendcount++; 279 280 /* is this an ack from a zephyr we sent? */ 281 if (owl_zephyr_notice_is_ack(¬ice)) { 282 owl_zephyr_handle_ack(¬ice); 283 continue; 284 } 285 286 /* if it's a ping and we're not viewing pings then skip it */ 287 if (!owl_global_is_rxping(&g) && !strcasecmp(notice.z_opcode, "ping")) { 288 continue; 289 } 290 291 /* create the new message */ 292 m=owl_malloc(sizeof(owl_message)); 293 owl_message_create_from_znotice(m, ¬ice); 277 if (ZPending()) { 278 /* grab a zephyr notice, but if we've done 20 without stopping, 279 take a break to process keystrokes etc. */ 280 if (zpendcount>20) break; 281 ZReceiveNotice(¬ice, &from); 282 zpendcount++; 283 284 /* is this an ack from a zephyr we sent? */ 285 if (owl_zephyr_notice_is_ack(¬ice)) { 286 owl_zephyr_handle_ack(¬ice); 287 continue; 288 } 289 290 /* if it's a ping and we're not viewing pings then skip it */ 291 if (!owl_global_is_rxping(&g) && !strcasecmp(notice.z_opcode, "ping")) { 292 continue; 293 } 294 295 /* create the new message */ 296 m=owl_malloc(sizeof(owl_message)); 297 owl_message_create_from_znotice(m, ¬ice); 298 } else if (owl_global_messagequeue_pending(&g)) { 299 m=owl_global_messageuque_popmsg(&g); 300 } 294 301 295 302 /* if it's on the puntlist then, nuke it and continue */ … … 301 308 /* otherwise add it to the global list */ 302 309 owl_messagelist_append_element(owl_global_get_msglist(&g), m); 303 new zephyrs=1;310 newmsgs=1; 304 311 305 312 /* let the config know the new message has been received */ … … 324 331 owl_function_command(owl_global_get_alert_action(&g)); 325 332 } 326 327 328 333 329 334 /* check for burning ears message */ … … 338 343 } 339 344 340 /* log the zephyrif we need to */345 /* log the message if we need to */ 341 346 if (owl_global_is_logging(&g) || owl_global_is_classlogging(&g)) { 342 347 owl_log_incoming(m); … … 344 349 } 345 350 351 /* If we're logged into AIM, do AIM stuff */ 352 if (owl_global_is_aimloggedin(&g)) { 353 owl_function_debugmsg("Doing aim processing"); 354 owl_aim_process_events(); 355 } 356 346 357 /* follow the last message if we're supposed to */ 347 if (new zephyrs && followlast) {358 if (newmsgs && followlast) { 348 359 owl_function_lastmsg_noredisplay(); 349 360 } 350 361 351 362 /* do the newmsgproc thing */ 352 if (new zephyrs) {363 if (newmsgs) { 353 364 owl_function_do_newmsgproc(); 354 365 } 355 366 356 367 /* redisplay if necessary */ 357 /* maybe this should be optimized to not even run if 358 the zephyr won't be displayed */ 359 if (newzephyrs) { 368 /* this should be optimized to not run if the new messages won't be displayed */ 369 if (newmsgs) { 360 370 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 361 371 sepbar(NULL); … … 394 404 } 395 405 396 /* handle all keypresses */ 406 /* Handle all keypresses. 407 * If no key has been pressed sleep for a little bit, but 408 * otherwise do not, this lets input be grabbed as quickly 409 * as possbile */ 397 410 j=wgetch(typwin); 398 411 if (j==ERR) { … … 426 439 } 427 440 } 428 429 441 } 430 442
Note: See TracChangeset
for help on using the changeset viewer.