Changeset 1e2fab5


Ignore:
Timestamp:
May 25, 2013, 3:46:12 PM (11 years ago)
Author:
Geoffrey Thomas <geofft@ldpreload.com>
Branches:
release-1.9
Children:
7558e19
Parents:
fc2b7ae
git-author:
David Benjamin <davidben@mit.edu> (11/14/12 15:22:41)
git-committer:
Geoffrey Thomas <geofft@ldpreload.com> (05/25/13 15:46:12)
Message:
Fix display of pseudologins

After b9517cf7ce2959a6e86a52d25a98b1d03df56d58, they lost fields and
auth keys. They're faked, so they don't really have fields or auth, but
put them in anyway to appease existing styles.

Reported-By: Kevin Chen <kchen@mit.edu>
(cherry picked from commit 6401db33a7a1c3156833113bbe6e9eec7a571406)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Message/Zephyr.pm

    rbf70350 r1e2fab5  
    5151    my ($m) = @_;
    5252    return undef if (!$m->is_loginout);
     53    return undef if (!defined($m->fields));
    5354    return $m->fields->[2];
    5455}
     
    5758    my ($m) = @_;
    5859    return undef if (!$m->is_loginout);
     60    return undef if (!defined($m->fields));
    5961    return $m->fields->[0];
    6062}
  • perlconfig.c

    rd199207 r1e2fab5  
    9292                                      owl_new_sv(owl_message_get_##field(m)), 0)
    9393
    94   if (owl_message_get_notice(m)) {
     94  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
    9595    /* Handle zephyr-specific fields... */
    96     AV *av_zfields;
    97 
    98     av_zfields = newAV();
    99     for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
    100          f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
    101       ptr=owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
    102       av_push(av_zfields, owl_new_sv(ptr));
    103       g_free(ptr);
     96    AV *av_zfields = newAV();
     97    if (owl_message_get_notice(m)) {
     98      for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
     99           f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
     100        ptr = owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
     101        av_push(av_zfields, owl_new_sv(ptr));
     102        g_free(ptr);
     103      }
     104      (void)hv_store(h, "auth", strlen("auth"),
     105                     owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))), 0);
     106    } else {
     107      /* Incoming zephyrs without a ZNotice_t are pseudo-logins. To appease
     108       * existing styles, put in bogus 'auth' and 'fields' keys. */
     109      (void)hv_store(h, "auth", strlen("auth"), owl_new_sv("NO"), 0);
    104110    }
    105111    (void)hv_store(h, "fields", strlen("fields"), newRV_noinc((SV*)av_zfields), 0);
    106 
    107     (void)hv_store(h, "auth", strlen("auth"),
    108                    owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))),0);
    109112  }
    110113
Note: See TracChangeset for help on using the changeset viewer.