Changeset 9eb9479


Ignore:
Timestamp:
Oct 7, 2009, 10:53:37 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
176434d
Parents:
443eea1
git-author:
Nelson Elhage <nelhage@mit.edu> (10/06/09 00:18:00)
git-committer:
Nelson Elhage <nelhage@mit.edu> (10/07/09 22:53:37)
Message:
Don't rely on zephyr_getsender() at startup.

With krb5 Zephyr, zephyr_getsender() is not guaranteed to work until
Zephyr has been initialized. If we're seeing zephyrs, it's probably a
safe bet to try calling it, but don't assume that it returns anything
meaningful at startup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/BarnOwl/Module/Twitter.pm

    rf0de278 r9eb9479  
    2626our @twitter_handles = ();
    2727our $default_handle = undef;
    28 my $user     = BarnOwl::zephyr_getsender();
    29 my ($class)  = ($user =~ /(^[^@]+)/);
     28my $class    = $ENV{USER};
    3029my $instance = "status";
    3130my $opcode   = "twitter";
     
    133132
    134133for my $cfg (@$raw_cfg) {
    135     my $twitter_args = { username   => $cfg->{user} || $user,
     134    my $twitter_args = { username   => $cfg->{user},
    136135                        password   => $cfg->{password},
    137136                        source     => 'barnowl',
     
    176175    my $m = shift;
    177176    ($class, $instance, $opcode) = map{BarnOwl::getvar("twitter:$_")} qw(class instance opcode);
    178     if($m->sender eq $user
     177    if($m->sender eq BarnOwl::zephyr_getsender()
    179178       && match($m->class, $class)
    180179       && match($m->instance, $instance)
Note: See TracChangeset for help on using the changeset viewer.