Changeset 13a3c1db for zephyr.c


Ignore:
Timestamp:
May 30, 2007, 12:05:27 AM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4508e21
Parents:
1fd5e4c1
git-author:
Nelson Elhage <nelhage@mit.edu> (05/30/07 00:05:16)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/30/07 00:05:27)
Message:
Refactoring message processing: All new messages, incoming or
outgoing, get added to the owl_global_messagequeue by protocol code,
and then passed to owl_proces_message, which serves as a single
central code path for adding messages to the message list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r85d1795 r13a3c1db  
    638638  /* display the message as an admin message in the receive window */
    639639  mout=owl_function_make_outgoing_zephyr(owl_global_get_zaway_msg(&g), tmpbuff, "Automated reply:");
    640   owl_function_add_message(mout);
     640  owl_global_messagequeue_addmsg(&g, mout);
    641641  owl_free(tmpbuff);
    642642#endif
     
    10541054#endif
    10551055}
     1056
     1057#ifdef HAVE_LIBZEPHYR
     1058void owl_zephyr_process_events() {
     1059  int zpendcount=0;
     1060  ZNotice_t notice;
     1061  struct sockaddr_in from;
     1062  owl_message *m=NULL;
     1063
     1064  while(owl_zephyr_zpending() && zpendcount < 20) {
     1065    if (owl_zephyr_zpending()) {
     1066      ZReceiveNotice(&notice, &from);
     1067      zpendcount++;
     1068
     1069      /* is this an ack from a zephyr we sent? */
     1070      if (owl_zephyr_notice_is_ack(&notice)) {
     1071        owl_zephyr_handle_ack(&notice);
     1072        continue;
     1073      }
     1074
     1075      /* if it's a ping and we're not viewing pings then skip it */
     1076      if (!owl_global_is_rxping(&g) && !strcasecmp(notice.z_opcode, "ping")) {
     1077        continue;
     1078      }
     1079
     1080      /* create the new message */
     1081      m=owl_malloc(sizeof(owl_message));
     1082      owl_message_create_from_znotice(m, &notice);
     1083
     1084      owl_global_messagequeue_addmsg(&g, m);
     1085    }
     1086  }
     1087}
     1088
     1089#else
     1090void owl_zephyr_process_events() {
     1091 
     1092}
     1093#endif
Note: See TracChangeset for help on using the changeset viewer.