Changeset 24ccc01 for zephyr.c


Ignore:
Timestamp:
Aug 26, 2009, 11:50:56 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e2ebf39
Parents:
36486be
git-author:
Nelson Elhage <nelhage@mit.edu> (08/19/09 23:41:06)
git-committer:
Nelson Elhage <nelhage@mit.edu> (08/26/09 23:50:56)
Message:
Replace owl_message_create_from_zwriteline with owl_message_create_from_zwrite.

By passing in a zwrite structure instead of a line, we make it easier to
construct faked messages without having to go through generaring and
parsing a zwrite command line. We change owl_zephyr_handle_ack to fake a
zwrite structure, fixing the segfault on zephyring users with
quotes (fixes #94), as well as logging errors sending instanced personals
slightly better.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r36486be r24ccc01  
    769769    } else {
    770770      char buff[BUFFLEN];
     771      owl_zwrite zw;
     772      char *realm;
     773
    771774      tmp = short_zuser(retnotice->z_recipient);
    772775      owl_function_error("%s: Not logged in or subscribing.", tmp);
     
    796799      }
    797800      owl_function_adminmsg("", buff);
    798       owl_log_outgoing_zephyr_error(tmp, buff);
     801
     802      memset(&zw, 0, sizeof(zw));
     803      zw.class = owl_strdup(retnotice->z_class);
     804      zw.inst  = owl_strdup(retnotice->z_class_inst);
     805      realm = strchr(retnotice->z_recipient, '@');
     806      if(realm) {
     807        zw.realm = owl_strdup(realm + 1);
     808      } else {
     809        zw.realm = owl_strdup(owl_zephyr_get_realm());
     810      }
     811      zw.opcode = owl_strdup(retnotice->z_opcode);
     812      zw.zsig   = owl_strdup("");
     813      owl_list_create(&(zw.recips));
     814      owl_list_append_element(&(zw.recips), owl_strdup(tmp));
     815
     816      owl_log_outgoing_zephyr_error(&zw, buff);
     817
     818      owl_zwrite_free(&zw);
    799819      owl_free(tmp);
    800820    }
Note: See TracChangeset for help on using the changeset viewer.