Changeset 3a3863e for message.c


Ignore:
Timestamp:
Mar 24, 2011, 5:00:34 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
fe3b017
Parents:
4e29ecb
Message:
Correctly compute the realm for outgoing messages

In particular, :zwrite user -r EXAMPLE.COM was not computing a recipient
of user@EXAMPLE.COM correctly. We also do not correctly set the realm on
the message: the realm attribute is the realm to which the zephyr was
sent.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r4e29ecb r3a3863e  
    961961  owl_message_set_instance(m, owl_zwrite_get_instance(z));
    962962  if (recip_index < owl_zwrite_get_numrecips(z)) {
    963     char *longzuser = long_zuser(owl_zwrite_get_recip_n(z, recip_index));
     963    char *zuser = owl_zwrite_get_recip_n_with_realm(z, recip_index);
     964    char *longzuser = long_zuser(zuser);
    964965    owl_message_set_recipient(m, longzuser);
     966    owl_message_set_realm(m, zuser_realm(longzuser));
    965967    g_free(longzuser);
     968    g_free(zuser);
     969  } else {
     970    /* TODO: We should maybe munge this into the case above, as that comparison
     971     * is a little overly clever. It's also not clear this codepath ever runs
     972     * anyway. */
     973    const char *realm = owl_zwrite_get_realm(z);
     974    owl_message_set_realm(m, realm[0] ? realm : owl_zephyr_get_realm());
    966975  }
    967976  owl_message_set_opcode(m, owl_zwrite_get_opcode(z));
    968   owl_message_set_realm(m, owl_zwrite_get_realm(z)); /* also a hack, but not here */
    969977
    970978  /* Although not strictly the zwriteline, anyone using the unsantized version
Note: See TracChangeset for help on using the changeset viewer.