Changeset 40def31a


Ignore:
Timestamp:
May 20, 2020, 7:21:29 PM (4 years ago)
Author:
GitHub <noreply@github.com>
Parents:
9a0d25d (diff), 834dc31 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Alex Dehnert <adehnert@mit.edu> (05/20/20 19:21:29)
git-committer:
GitHub <noreply@github.com> (05/20/20 19:21:29)
Message:
Merge 834dc312682e1820f1f2fa826ea9040caea8813f into 9a0d25d1513e92f2b0c99d89ab5fc5ae2c061151
Files:
44 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • README

    r1c22155 rfb27b30  
    5555The Twitter module requires:
    5656
    57 HTML::Entities
     57HTML::Entities (provided by HTML::Parser)
    5858Net::Twitter::Lite
    5959
  • perl/modules/Twitter/lib/BarnOwl/Message/Twitter.pm

    r8106870 r1f69b54  
    3333    if($self->is_private) {
    3434        return $self->replysendercmd;
    35     } elsif(exists($self->{status_id})) {
    36         return BarnOwl::quote('twitter-atreply', $self->sender, $self->{status_id}, $self->account);
     35    }
     36    # Roughly, this is how Twitter's @-reply calculation works
     37    # (based on a few experiments)
     38    #
     39    #   1. The person who wrote the tweet you are replying to is added.
     40    #      This is the only time when your own name can show up in an
     41    #      at-reply string.
     42    #   2. Next, Twitter goes through the Tweet front to back, adding
     43    #      mentioned usernames that have not already been added to the
     44    #      string.
     45    #
     46    # In degenerate cases, the at-reply string might be longer than
     47    # the max Tweet size; Twitter doesn't care.
     48
     49    # XXX A horrifying violation of encapsulation
     50    # NB: names array includes @-signs.
     51    my $account = BarnOwl::Module::Twitter::find_account_default($self->{account});
     52    my @inside_names = grep($_ ne ("@" . $account->{cfg}->{user}),
     53                            $self->{body} =~ /(?:^|\s)(@\w+)/g );
     54    my @dup_names = ( ( "@" . $self->sender ), @inside_names );
     55
     56    # XXX Really should use List::MoreUtils qw(uniq).  This code snippet
     57    # lifted from `perldoc -q duplicate`.
     58    my %seen = ();
     59    my @names = grep { ! $seen{ $_ }++ } @dup_names;
     60    my $prefill = join(' ', @names) . ' '; # NB need trailing space
     61
     62    if(exists($self->{status_id})) {
     63        return BarnOwl::quote('twitter-prefill', $prefill, $self->{status_id}, $self->account);
    3764    } else {
    38         return BarnOwl::quote('twitter-atreply', $self->sender, $self->account);
     65        # Give a dummy status ID
     66        return BarnOwl::quote('twitter-prefill', $prefill, '', $self->account);
    3967    }
    4068}
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm

    r140429f r1f69b54  
    243243BarnOwl::new_command(twitter => \&cmd_twitter, {
    244244    summary     => 'Update Twitter from BarnOwl',
    245     usage       => 'twitter [ACCOUNT] [MESSAGE]',
     245    usage       => 'twitter [ACCOUNT [MESSAGE]]',
    246246    description => 'Update Twitter on ACCOUNT. If MESSAGE is provided, use it as your status.'
    247247    . "\nIf no ACCOUNT is provided, update all services which have publishing enabled."
     
    259259    {
    260260    summary     => 'Send a Twitter @ message',
    261     usage       => 'twitter-atreply USER [ACCOUNT]',
     261    usage       => 'twitter-atreply USER [ID [ACCOUNT]]',
    262262    description => 'Send a Twitter @reply Message to USER on ACCOUNT (defaults to default_sender,'
     263    . "\nor first service if no default is provided)"
     264    }
     265);
     266
     267BarnOwl::new_command( 'twitter-prefill' => sub { cmd_twitter_prefill(@_); },
     268    {
     269    summary     => 'Send a Twitter message with prefilled text',
     270    usage       => 'twitter-prefill PREFILL [ID [ACCOUNT]]',
     271    description => 'Send a Twitter message with initial text PREFILL on ACCOUNT (defaults to default_sender,'
    263272    . "\nor first service if no default is provided)"
    264273    }
     
    356365                            sub { $account->twitter_atreply($user, $id, shift) });
    357366    BarnOwl::Editwin::insert_text("\@$user ");
     367}
     368
     369sub cmd_twitter_prefill {
     370    my $cmd  = shift;
     371    # prefill is responsible for spacing
     372    my $prefill = shift || die("Usage: $cmd PREFILL [In-Reply-To ID]\n");
     373    my $id   = shift;
     374    my $account = find_account_default(shift);
     375
     376    my $msg = "What's happening?";
     377    if ($id) {
     378        # So, this isn't quite semantically correct, but it's close
     379        # enough, and under the planned use-case, it will look identical.
     380        $msg = "Reply to " . $prefill;
     381    }
     382    if ($account->nickname) {
     383        # XXX formatting slightly suboptimal on What's happening message;
     384        # and the behavior does not match up with 'twitter' anyhoo,
     385        # which doesn't dispatch through account_find_default
     386        $msg .= " on " . $account->nickname;
     387    }
     388    BarnOwl::start_edit_win($msg,
     389                            sub { $account->twitter_atreply(undef, $id, shift) });
     390    BarnOwl::Editwin::insert_text($prefill);
    358391}
    359392
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm

    r140429f r834dc31  
    290290            $orig = $tweet unless defined($orig);
    291291
     292            my $url = $self->{cfg}->{service} . '/' . $orig->{user}{screen_name} . '/status/' . $tweet->{id};
    292293            my $msg = BarnOwl::Message->new(
    293294                type      => 'Twitter',
     
    299300                body      => decode_entities($orig->{text}),
    300301                status_id => $tweet->{id},
     302                url       => $url,
    301303                service   => $self->{cfg}->{service},
    302304                account   => $self->{cfg}->{account_nickname},
  • Makefile.am

    r392b5cf r4fd3c04  
    4343dist_doc_DATA = doc/intro.txt doc/advanced.txt
    4444
    45 bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a
     45bin_barnowl_LDADD = compat/libcompat.a
    4646
    4747bin_tester_SOURCES = $(BASE_SRCS) \
     
    5050nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H)
    5151
    52 bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a
     52bin_tester_LDADD = compat/libcompat.a
    5353
    5454TESTS=runtests.sh
    5555
    5656AM_CPPFLAGS = \
    57            -I$(top_srcdir)/libfaim/ \
    5857           -DDATADIR='"$(pkgdatadir)"' \
    5958           -DBINDIR='"$(bindir)"'
     
    6564     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
    6665     keypress.c keymap.c keybinding.c cmd.c context.c \
    67      aim.c buddy.c buddylist.c style.c errqueue.c \
     66     style.c errqueue.c \
    6867     zbuddylist.c popexec.c select.c wcwidth.c \
    6968     mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
     
    125124    cpanfile
    126125
    127 SUBDIRS = compat libfaim perl
     126SUBDIRS = compat perl
  • codelist.pl

    r06adc25 r4fd3c04  
    1818            && !/^XS/
    1919            && !/\/\*/
    20             && !/ZWRITEOPTIONS/
    21             && !/owlfaim_priv/)
     20            && !/ZWRITEOPTIONS/)
    2221        {
    2322
  • commands.c

    r4511ac3 r4fd3c04  
    122122              "      Send to the specified opcode\n"),
    123123
    124   OWLCMD_ARGS("aimwrite", owl_command_aimwrite, OWL_CTX_INTERACTIVE,
    125               "send an AIM message",
    126               "aimwrite <user> [-m <message...>]",
    127               "Send an aim message to a user.\n\n"
    128               "The following options are available:\n\n"
    129               "-m    Specifies a message to send without prompting.\n"),
    130 
    131124  OWLCMD_ARGS("loopwrite", owl_command_loopwrite, OWL_CTX_INTERACTIVE,
    132125              "send a loopback message",
     
    234227              "Execute the BarnOwl commands in <filename>.\n"),
    235228
    236   OWLCMD_ARGS("aim", owl_command_aim, OWL_CTX_INTERACTIVE,
    237               "AIM specific commands",
    238               "aim search <email>",
    239               ""),
    240 
    241229  OWLCMD_ARGS("addbuddy", owl_command_addbuddy, OWL_CTX_INTERACTIVE,
    242230              "add a buddy to a buddylist",
    243231              "addbuddy <protocol> <screenname>",
    244               "Add the named buddy to your buddylist.  <protocol> can be aim or zephyr\n"),
     232              "Add the named buddy to your buddylist.  <protocol> must be zephyr\n"),
    245233
    246234  OWLCMD_ARGS("delbuddy", owl_command_delbuddy, OWL_CTX_INTERACTIVE,
    247235              "delete a buddy from a buddylist",
    248236              "delbuddy <protocol> <screenname>",
    249               "Delete the named buddy from your buddylist.  <protocol> can be aim or zephyr\n"),
    250 
    251   OWLCMD_ARGS("join", owl_command_join, OWL_CTX_INTERACTIVE,
    252               "join a chat group",
    253               "join aim <groupname> [exchange]",
    254               "Join the AIM chatroom with 'groupname'.\n"),
     237              "Delete the named buddy from your buddylist.  <protocol> must be zephyr\n"),
    255238
    256239  OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
     
    308291              "znol [-f file]",
    309292              "Print a znol-style listing of users logged in"),
    310 
    311   OWLCMD_VOID("alist", owl_command_alist, OWL_CTX_INTERACTIVE,
    312               "List AIM users logged in",
    313               "alist",
    314               "Print a listing of AIM users logged in"),
    315293
    316294  OWLCMD_VOID("blist", owl_command_blist, OWL_CTX_INTERACTIVE,
     
    470448              "use the default.\n"),
    471449
    472   OWLCMD_ARGS("aaway", owl_command_aaway, OWL_CTX_INTERACTIVE,
    473               "Set, enable or disable AIM away message",
    474               "aaway [ on | off | toggle ]\n"
    475               "aaway <message>",
    476               "Turn on or off the AIM away message.  If 'message' is\n"
    477               "specified turn on aaway with that message, otherwise\n"
    478               "use the default.\n"),
    479 
    480450  OWLCMD_ARGS("away", owl_command_away, OWL_CTX_INTERACTIVE,
    481451              "Set, enable or disable all away messages",
     
    486456              "otherwise use the default.\n"
    487457              "\n"
    488               "SEE ALSO: aaway, zaway"),
     458              "SEE ALSO: zaway"),
    489459
    490460  OWLCMD_ARGS("flush-logs", owl_command_flushlogs, OWL_CTX_ANY,
     
    548518              "    body       -  message body\n"
    549519              "    hostname   -  hostname of sending host\n"
    550               "    type       -  message type (zephyr, aim, admin)\n"
     520              "    type       -  message type (zephyr, admin)\n"
    551521              "    direction  -  either 'in' 'out' or 'none'\n"
    552522              "    login      -  either 'login' 'logout' or 'none'\n"
     
    772742          "no argument, it makes search highlighting inactive."),
    773743
    774   OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY,
    775               "login to an AIM account",
    776               "aimlogin <screenname> [<password>]\n",
    777               ""),
    778 
    779   OWLCMD_ARGS("aimlogout", owl_command_aimlogout, OWL_CTX_ANY,
    780               "logout from AIM",
    781               "aimlogout\n",
    782               ""),
    783 
    784744  OWLCMD_ARGS("error", owl_command_error, OWL_CTX_ANY,
    785745              "Display an error message",
     
    11081068    }
    11091069  }
    1110   owl_function_buddylist(0, 1, file);
     1070  owl_function_buddylist(1, file);
    11111071  return(NULL);
    11121072}
    11131073
    1114 void owl_command_alist(void)
    1115 {
    1116   owl_function_buddylist(1, 0, NULL);
    1117 }
    1118 
    11191074void owl_command_blist(void)
    11201075{
    1121   owl_function_buddylist(1, 1, NULL);
     1076  owl_function_buddylist(1, NULL);
    11221077}
    11231078
     
    11351090{
    11361091  owl_function_makemsg("BarnOwl version %s", version);
    1137 }
    1138 
    1139 char *owl_command_aim(int argc, const char *const *argv, const char *buff)
    1140 {
    1141   if (argc<2) {
    1142     owl_function_makemsg("not enough arguments to aim command");
    1143     return(NULL);
    1144   }
    1145 
    1146   if (!strcmp(argv[1], "search")) {
    1147     if (argc!=3) {
    1148       owl_function_makemsg("not enough arguments to aim search command");
    1149       return(NULL);
    1150     }
    1151     owl_aim_search(argv[2]);
    1152   } else {
    1153     owl_function_makemsg("unknown subcommand '%s' for aim command", argv[1]);
    1154     return(NULL);
    1155   }
    1156   return(NULL);
    11571092}
    11581093
     
    11641099  }
    11651100
    1166   if (!strcasecmp(argv[1], "aim")) {
    1167     if (!owl_global_is_aimloggedin(&g)) {
    1168       owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
    1169       return(NULL);
    1170     }
    1171     /*
    1172     owl_function_makemsg("This function is not yet operational.  Stay tuned.");
    1173     return(NULL);
    1174     */
    1175     owl_aim_addbuddy(argv[2]);
    1176     owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
    1177   } else if (!strcasecmp(argv[1], "zephyr")) {
     1101  if (!strcasecmp(argv[1], "zephyr")) {
    11781102    owl_zephyr_addbuddy(argv[2]);
    11791103    owl_function_makemsg("%s added as zephyr buddy", argv[2]);
    11801104  } else {
    1181     owl_function_makemsg("addbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
     1105    owl_function_makemsg("addbuddy: currently the only supported protocol is 'zephyr'");
    11821106  }
    11831107
     
    11921116  }
    11931117
    1194   if (!strcasecmp(argv[1], "aim")) {
    1195     if (!owl_global_is_aimloggedin(&g)) {
    1196       owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
    1197       return(NULL);
    1198     }
    1199     owl_aim_delbuddy(argv[2]);
    1200     owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
    1201   } else if (!strcasecmp(argv[1], "zephyr")) {
     1118  if (!strcasecmp(argv[1], "zephyr")) {
    12021119    owl_zephyr_delbuddy(argv[2]);
    12031120    owl_function_makemsg("%s deleted as zephyr buddy", argv[2]);
    12041121  } else {
    1205     owl_function_makemsg("delbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
    1206   }
    1207 
    1208   return(NULL);
    1209 }
    1210 
    1211 char *owl_command_join(int argc, const char *const *argv, const char *buff)
    1212 {
    1213   if (argc!=3 && argc!=4) {
    1214     owl_function_makemsg("usage: join <protocol> <buddyname> [exchange]");
    1215     return(NULL);
    1216   }
    1217 
    1218   if (!strcasecmp(argv[1], "aim")) {
    1219     if (!owl_global_is_aimloggedin(&g)) {
    1220       owl_function_makemsg("join aim: You must be logged into aim to use this command.");
    1221       return(NULL);
    1222     }
    1223     if (argc==3) {
    1224       owl_aim_chat_join(argv[2], 4);
    1225     } else {
    1226       owl_aim_chat_join(argv[2], atoi(argv[3]));
    1227     }
    1228     /* owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g)); */
    1229   } else {
    1230     owl_function_makemsg("join: currently the only supported protocol is 'aim'");
    1231   }
     1122    owl_function_makemsg("delbuddy: currently the only supported protocol is 'zephyr'");
     1123  }
     1124
    12321125  return(NULL);
    12331126}
     
    15391432
    15401433
    1541 char *owl_command_aaway(int argc, const char *const *argv, const char *buff)
    1542 {
    1543   if ((argc==1) ||
    1544       ((argc==2) && !strcmp(argv[1], "on"))) {
    1545     owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g));
    1546     owl_function_aaway_on();
    1547     return NULL;
    1548   }
    1549 
    1550   if (argc==2 && !strcmp(argv[1], "off")) {
    1551     owl_function_aaway_off();
    1552     return NULL;
    1553   }
    1554 
    1555   if (argc==2 && !strcmp(argv[1], "toggle")) {
    1556     owl_function_aaway_toggle();
    1557     return NULL;
    1558   }
    1559 
    1560   buff = skiptokens(buff, 1);
    1561   owl_global_set_aaway_msg(&g, buff);
    1562   owl_function_aaway_on();
    1563   return NULL;
    1564 }
    1565 
    1566 
    15671434char *owl_command_away(int argc, const char *const *argv, const char *buff)
    15681435{
     
    15731440      (argc == 2 && !strcmp(argv[1], "on"))) {
    15741441    away_off = false;
    1575     owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g));
    15761442    owl_global_set_zaway_msg(&g, owl_global_get_zaway_msg_default(&g));
    15771443  } else if (argc == 2 && !strcmp(argv[1], "off")) {
     
    15851451
    15861452  if (away_off) {
    1587     owl_function_aaway_off();
    15881453    owl_function_zaway_off();
    15891454    owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_off", 0, NULL);
    15901455    owl_function_makemsg("Away messages off.");
    15911456  } else if (message != NULL) {
    1592     owl_global_set_aaway_msg(&g, message);
    15931457    owl_global_set_zaway_msg(&g, message);
    1594     owl_function_aaway_on();
    15951458    owl_function_zaway_on();
    15961459    owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_on", 1, &message);
    15971460    owl_function_makemsg("Away messages set (%s).", message);
    15981461  } else {
    1599     owl_function_aaway_on();
    16001462    owl_function_zaway_on();
    16011463    owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_on", 0, NULL);
     
    20381900  }
    20391901  return(NULL);
    2040 }
    2041 
    2042 char *owl_command_aimwrite(int argc, const char *const *argv, const char *buff)
    2043 {
    2044   char *message = NULL;
    2045   GString *recip = g_string_new("");
    2046   const char *const *myargv;
    2047   int myargc;
    2048  
    2049   if (!owl_global_is_aimloggedin(&g)) {
    2050     owl_function_error("You are not logged in to AIM.");
    2051     goto err;
    2052   }
    2053 
    2054   /* Skip argv[0]. */
    2055   myargv = argv+1;
    2056   myargc = argc-1;
    2057   while (myargc) {
    2058     if (!strcmp(myargv[0], "-m")) {
    2059       if (myargc <= 1) {
    2060         owl_function_error("No message specified.");
    2061         goto err;
    2062       }
    2063       /* Once we have -m, gobble up everything else on the line */
    2064       myargv++;
    2065       myargc--;
    2066       message = g_strjoinv(" ", (char**)myargv);
    2067       break;
    2068     } else {
    2069       /* squish arguments together to make one screenname w/o spaces for now */
    2070       g_string_append(recip, myargv[0]);
    2071       myargv++;
    2072       myargc--;
    2073     }
    2074   }
    2075 
    2076   if (recip->str[0] == '\0') {
    2077     owl_function_error("No recipient specified");
    2078     goto err;
    2079   }
    2080 
    2081   if (message != NULL)
    2082     owl_function_aimwrite(recip->str, message, false);
    2083   else
    2084     owl_function_aimwrite_setup(recip->str);
    2085  err:
    2086   g_string_free(recip, true);
    2087   g_free(message);
    2088   return NULL;
    20891902}
    20901903
     
    26542467}
    26552468
    2656 char *owl_command_aimlogin(int argc, const char *const *argv, const char *buff)
    2657 {
    2658   if ((argc<2) || (argc>3)) {
    2659     owl_function_makemsg("Wrong number of arguments to aimlogin command");
    2660     return(NULL);
    2661   }
    2662 
    2663   /* if we get two arguments, ask for the password */
    2664   if (argc==2) {
    2665     owl_editwin *e = owl_function_start_password("AIM Password: ");
    2666     owl_editwin_set_cbdata(e, g_strdup(argv[1]), g_free);
    2667     owl_editwin_set_callback(e, owl_callback_aimlogin);
    2668     return(NULL);
    2669   } else {
    2670     owl_function_aimlogin(argv[1], argv[2]);
    2671   }
    2672 
    2673   /* this is a test */
    2674   return(NULL);
    2675 }
    2676 
    2677 char *owl_command_aimlogout(int argc, const char *const *argv, const char *buff)
    2678 {
    2679   /* clear the buddylist */
    2680   owl_buddylist_clear(owl_global_get_buddylist(&g));
    2681 
    2682   owl_aim_logout();
    2683   return(NULL);
    2684 }
    2685 
    26862469CALLER_OWN char *owl_command_getstyle(int argc, const char *const *argv, const char *buff)
    26872470{
  • configure.ac

    r370d94d r9a0d25d  
    5454  [with_zephyr=check])
    5555
    56 AC_ARG_WITH([krb4],
    57   AS_HELP_STRING([--with-krb4],
    58                  [Build with kerberos IV]))
    59 
    6056AS_IF([test "x$with_zephyr" != xno],
    61   [have_krb4=no
    62 
    63    AS_IF([test "x$with_krb4" != "xno"],
    64    [AC_MSG_CHECKING([for Kerberos IV])
    65     AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
    66       [AC_MSG_RESULT([yes])
    67        have_krb4=yes
    68        AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
    69        AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`"
    70        LIBS="${LIBS} `krb5-config krb4 --libs`"
    71       ],
    72       [AC_MSG_RESULT([no])
    73        AS_IF([test "x$with_krb4" = "xyes"],
    74              [AC_MSG_ERROR([Kerberos IV requested but not found])])])])
    75 
    76    AS_IF([test "x$have_krb4" != xyes],
    77      [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto],
    78         [AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
    79          LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
    80         ],
    81         [PKG_CHECK_MODULES([OPENSSL], [openssl],
    82            [AM_CFLAGS="${AM_CFLAGS} ${OPENSSL_CFLAGS}"
    83             LIBS="${LIBS} ${OPENSSL_LIBS}"
    84            ])])])
     57  [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto],
     58     [AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
     59      LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
     60     ],
     61     [PKG_CHECK_MODULES([OPENSSL], [openssl],
     62        [AM_CFLAGS="${AM_CFLAGS} ${OPENSSL_CFLAGS}"
     63         LIBS="${LIBS} ${OPENSSL_LIBS}"
     64        ])])
    8565
    8666   AC_CHECK_LIB([zephyr], [ZGetSender],
     
    10282AC_CHECK_FUNCS([use_default_colors])
    10383AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])])
    104 AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
    105 AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
    106 AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1])
     84AC_CHECK_FUNCS([DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
     85AC_CHECK_FUNCS([DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
     86AC_CHECK_FUNCS([DES_key_sched], [HAVE_DES_KEY_SCHED=1])
    10787
    10888dnl Checks for header files.
     
    176156AX_APPEND_COMPILE_FLAGS([-Wno-format-zero-length],[AM_CFLAGS])
    177157
    178 AX_APPEND_COMPILE_FLAGS([-Wno-pointer-sign -Wno-empty-body -Wno-unused-value],[LIBFAIM_CFLAGS])
    179 
    180158AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
    181159                                 test "$HAVE_DES_KEY_SCHED" && dnl
     
    183161
    184162AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600"
    185 dnl Define _BSD_SOURCE because zephyr needs caddr_t.
    186 AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE"
     163dnl Define _BSD_SOURCE/_DEFAULT_SOURCE because zephyr needs caddr_t.
     164AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"
    187165dnl Define __EXTENSIONS__ for strcasecmp on Solaris.
    188166AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__"
     
    194172
    195173AC_SUBST([AM_CFLAGS])
    196 AC_SUBST([LIBFAIM_CFLAGS])
    197174
    198175AC_SUBST(XSUBPPDIR)
     
    213190AC_SUBST([abs_srcdir])
    214191
    215 AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
     192AC_CONFIG_FILES([Makefile compat/Makefile perl/Makefile perl/modules/Makefile])
    216193AC_OUTPUT
  • doc/advanced.txt

    rc82b055 r4fd3c04  
    4242     realm         zephyr realm
    4343     body          message body
    44      type          message type ('zephyr', 'aim', 'admin')
     44     type          message type ('zephyr', 'admin')
    4545     direction     either 'in' 'out' or 'none'\n"
    4646     login         either 'login' 'logout' or 'none'\n"
     
    103103All owl::Message objects contain the following methods:
    104104
    105     type      - returns the type of the message ("zephyr", "aim", "admin")
     105    type      - returns the type of the message ("zephyr", "admin")
    106106    direction - returns "in" or "out" for incoming or outgoing messages
    107107    time      - returns a string of the time when the message showed up
     
    126126
    127127    header      - returns the admin message header line  (admin)
    128     is_personal - returns true if this is a personal message (aim,zephyr)
     128    is_personal - returns true if this is a personal message (zephyr)
    129129    is_private  - returns true if this was a private message (zephyr)
    130130    login_tty   - returns the login tty for login messages (zephyr)
  • doc/intro.txt

    rd7cc50b r4fd3c04  
    88
    99Owl is a tty, curses-based instant messaging client.  This is a quick
    10 guide to learning how to use it.  Currently Owl supports AIM & zephyr,
     10guide to learning how to use it.  Currently Owl supports zephyr,
    1111but other messaging protocols, including Jabber, are on the way.  Some
    1212major features of owl include:
     
    7373If you wish to send to a class/instance pair simply supply -c and -i
    7474arguments to the zwrite command as you normally would.
    75 
    76 Sending an AIM message
    77 ----------------------
    78 
    79 Before sending an AIM message you must login to AOL Instant Messenger.
    80 Use the 'aimlogin' command, with your screenname as an argument:
    81 
    82      aimlogin <screenname>
    83 
    84 You will be prompted for your password, which you must enter.  Once
    85 you are successfully logged in you can send an AIM message by pressing
    86 the 'a' key, which will bring up an 'aimwrite' command:
    87 
    88      aimwrite <screenname>
    89 
    90 Supply the screen name you wish to write to as an argument and then
    91 send the message just as you would send a zephyr, as described above.
    9275
    9376Manipulating Messages
     
    256239     auto             Messages generated by automated programs
    257240     out              Messages sent from you to another user
    258      aim              AIM messages
    259241     zephyr           Zephyr messages
    260242     trash            "Trash" messages
  • filter.c

    r7dcef03 r9e596f5  
    1616owl_filter *owl_filter_new(const char *name, int argc, const char *const *argv)
    1717{
     18  return owl_filter_new_colored(name, argc, argv, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
     19}
     20
     21owl_filter *owl_filter_new_colored(const char *name, int argc, const char *const *argv, int fgcolor, int bgcolor)
     22{
    1823  owl_filter *f;
    1924
     
    2126
    2227  f->name=g_strdup(name);
    23   f->fgcolor=OWL_COLOR_DEFAULT;
    24   f->bgcolor=OWL_COLOR_DEFAULT;
    25 
    26   /* first take arguments that have to come first */
    27   /* set the color */
    28   while ( argc>=2 && ( !strcmp(argv[0], "-c") ||
    29                        !strcmp(argv[0], "-b") ) ) {
    30     if (owl_util_string_to_color(argv[1])==OWL_COLOR_INVALID) {
    31       owl_function_error("The color '%s' is not available, using default.", argv[1]);
    32     } else {
    33       switch (argv[0][1]) {
    34       case 'c':
    35         f->fgcolor=owl_util_string_to_color(argv[1]);
    36         break;
    37       case 'b':
    38         f->bgcolor=owl_util_string_to_color(argv[1]);
    39         break;
    40       }
    41     }
    42     argc-=2;
    43     argv+=2;
    44   }
     28  f->fgcolor = fgcolor;
     29  f->bgcolor = bgcolor;
    4530
    4631  if (!(f->root = owl_filter_parse_expression(argc, argv, NULL))) {
  • functions.c

    rb61ad80 r9e596f5  
    170170    "':sub @b(class)', and then type ':zwrite -c @b(class)' to send.\n\n"
    171171#endif
    172     "@b(AIM:)\n"
    173     "Log in to AIM with ':aimlogin @b(screenname)'. Use ':aimwrite @b(screenname)',\n"
    174     "or 'a' and then the screen name, to send someone a message.\n\n"
    175172    ;
    176173
     
    239236}
    240237
    241 /* Create an outgoing AIM message, returns a pointer to the created
    242  * message or NULL if we're not logged into AIM (and thus unable to
    243  * create the message).  Does not put it on the global queue.  Use
    244  * owl_global_messagequeue_addmsg() for that.
    245  */
    246 CALLER_OWN owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
    247 {
    248   owl_message *m;
    249 
    250   /* error if we're not logged into aim */
    251   if (!owl_global_is_aimloggedin(&g)) return(NULL);
    252  
    253   m=g_slice_new(owl_message);
    254   owl_message_create_aim(m,
    255                          owl_global_get_aim_screenname(&g),
    256                          to,
    257                          body,
    258                          OWL_MESSAGE_DIRECTION_OUT,
    259                          0);
    260   return(m);
    261 }
    262 
    263238/* Create an outgoing loopback message and return a pointer to it.
    264239 * Does not append it to the global queue, use
     
    325300}
    326301
    327 void owl_function_aimwrite_setup(const char *to)
    328 {
    329   owl_editwin *e;
    330   /* TODO: We probably actually want an owl_aimwrite object like
    331    * owl_zwrite. */
    332   char *line = g_strdup_printf("aimwrite %s", to);
    333   owl_function_write_setup("message");
    334   e = owl_function_start_edit_win(line);
    335   owl_editwin_set_cbdata(e, g_strdup(to), g_free);
    336   owl_editwin_set_callback(e, &owl_callback_aimwrite);
    337   g_free(line);
    338 }
    339 
    340302void owl_function_loopwrite_setup(void)
    341303{
     
    436398  g_free(cryptmsg);
    437399  g_free(old_msg);
    438 }
    439 
    440 void owl_callback_aimwrite(owl_editwin *e, bool success)
    441 {
    442   if (!success) return;
    443   char *to = owl_editwin_get_cbdata(e);
    444   owl_function_aimwrite(to, owl_editwin_get_text(e), true);
    445 }
    446 
    447 void owl_function_aimwrite(const char *to, const char *msg, bool unwrap)
    448 {
    449   int ret;
    450   char *format_msg;
    451   owl_message *m;
    452 
    453   /* make a formatted copy of the message */
    454   format_msg = g_strdup(msg);
    455   if (unwrap)
    456     owl_text_wordunwrap(format_msg);
    457  
    458   /* send the message */
    459   ret=owl_aim_send_im(to, format_msg);
    460   if (!ret) {
    461     owl_function_makemsg("AIM message sent.");
    462   } else {
    463     owl_function_error("Could not send AIM message.");
    464   }
    465 
    466   /* create the outgoing message */
    467   m=owl_function_make_outgoing_aim(msg, to);
    468 
    469   if (m) {
    470     owl_global_messagequeue_addmsg(&g, m);
    471   } else {
    472     owl_function_error("Could not create outgoing AIM message");
    473   }
    474 
    475   g_free(format_msg);
    476 }
    477 
    478 void owl_function_send_aimawymsg(const char *to, const char *msg)
    479 {
    480   int ret;
    481   char *format_msg;
    482   owl_message *m;
    483 
    484   /* make a formatted copy of the message */
    485   format_msg=g_strdup(msg);
    486   owl_text_wordunwrap(format_msg);
    487  
    488   /* send the message */
    489   ret=owl_aim_send_awaymsg(to, format_msg);
    490   if (!ret) {
    491     /* owl_function_makemsg("AIM message sent."); */
    492   } else {
    493     owl_function_error("Could not send AIM message.");
    494   }
    495 
    496   /* create the message */
    497   m=owl_function_make_outgoing_aim(msg, to);
    498   if (m) {
    499     owl_global_messagequeue_addmsg(&g, m);
    500   } else {
    501     owl_function_error("Could not create AIM message");
    502   }
    503   g_free(format_msg);
    504400}
    505401
     
    918814}
    919815
    920 void owl_callback_aimlogin(owl_editwin *e, bool success)
    921 {
    922   if (!success) return;
    923   char *user = owl_editwin_get_cbdata(e);
    924   owl_function_aimlogin(user,
    925                         owl_editwin_get_text(e));
    926 }
    927 
    928 void owl_function_aimlogin(const char *user, const char *passwd) {
    929   int ret;
    930 
    931   /* clear the buddylist */
    932   owl_buddylist_clear(owl_global_get_buddylist(&g));
    933 
    934   /* try to login */
    935   ret=owl_aim_login(user, passwd);
    936   if (ret) owl_function_makemsg("Warning: login for %s failed.\n", user);
    937 }
    938 
    939816void owl_function_suspend(void)
    940817{
     
    969846}
    970847
    971 void owl_function_aaway_toggle(void)
    972 {
    973   if (!owl_global_is_aaway(&g)) {
    974     owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g));
    975     owl_function_aaway_on();
    976   } else {
    977     owl_function_aaway_off();
    978   }
    979 }
    980 
    981 void owl_function_aaway_on(void)
    982 {
    983   owl_global_set_aaway_on(&g);
    984   /* owl_aim_set_awaymsg(owl_global_get_zaway_msg(&g)); */
    985   owl_function_makemsg("AIM away set (%s)", owl_global_get_aaway_msg(&g));
    986 }
    987 
    988 void owl_function_aaway_off(void)
    989 {
    990   owl_global_set_aaway_off(&g);
    991   /* owl_aim_set_awaymsg(""); */
    992   owl_function_makemsg("AIM away off");
    993 }
    994 
    995848bool owl_function_is_away(void)
    996849{
    997850  return owl_global_is_zaway(&g) ||
    998          owl_global_is_aaway(&g) ||
    999851         owl_perlconfig_perl_call_bool("BarnOwl::Hooks::_get_is_away", 0, NULL);
    1000852}
     
    1017869  if (owl_global_get_newmsgproc_pid(&g)) {
    1018870    kill(owl_global_get_newmsgproc_pid(&g), SIGHUP);
    1019   }
    1020  
    1021   /* Quit AIM */
    1022   if (owl_global_is_aimloggedin(&g)) {
    1023     owl_aim_logout();
    1024871  }
    1025872
     
    12261073  FILE *file;
    12271074  time_t now;
     1075  struct tm tm;
    12281076  va_list ap;
    12291077
     
    12371085  now = time(NULL);
    12381086
    1239   tmpbuff = owl_util_format_time(localtime(&now));
     1087  tmpbuff = owl_util_format_time(localtime_r(&now, &tm));
    12401088  fprintf(file, "[%d -  %s - %lds]: ",
    12411089          (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g));
     
    17751623  char buff[MAXPATHLEN+1];
    17761624  time_t start;
     1625  struct tm tm;
    17771626  int up, days, hours, minutes;
    17781627  owl_fmtext fm;
     
    18001649  owl_fmtext_append_normal(&fm, "\n");
    18011650
    1802   tmpbuff = owl_util_format_time(localtime(&start));
     1651  tmpbuff = owl_util_format_time(localtime_r(&start, &tm));
    18031652  owl_fmtext_appendf_normal(&fm, "  Startup Time: %s\n", tmpbuff);
    18041653  g_free(tmpbuff);
     
    18201669    owl_fmtext_append_normal(&fm, "no\n");
    18211670  }
    1822   owl_fmtext_append_normal(&fm, "  AIM included       : yes\n");
    18231671  owl_fmtext_append_normal(&fm, "  Loopback included  : yes\n");
    18241672
     
    18311679  owl_fmtext_append_normal(&fm, "no\n");
    18321680#endif
    1833  
    1834 
    1835   owl_fmtext_append_normal(&fm, "\nAIM Status:\n");
    1836   owl_fmtext_append_normal(&fm, "  Logged in: ");
    1837   if (owl_global_is_aimloggedin(&g)) {
    1838     owl_fmtext_append_normal(&fm, owl_global_get_aim_screenname(&g));
    1839     owl_fmtext_append_normal(&fm, "\n");
    1840   } else {
    1841     owl_fmtext_append_normal(&fm, "(not logged in)\n");
    1842   }
    1843 
    1844   owl_fmtext_append_normal(&fm, "  Processing events: ");
    1845   if (owl_global_is_doaimevents(&g)) {
    1846     owl_fmtext_append_normal(&fm, "yes\n");
    1847   } else {
    1848     owl_fmtext_append_normal(&fm, "no\n");
    1849   }
    18501681
    18511682  owl_function_popless_fmtext(&fm);
     
    21491980  const owl_view *v;
    21501981  int inuse = 0;
     1982  int i = 2;
     1983  int fgcolor = OWL_COLOR_DEFAULT;
     1984  bool set_fgcolor = false;
     1985  int bgcolor = OWL_COLOR_DEFAULT;
     1986  bool set_bgcolor = false;
    21511987
    21521988  if (argc < 2) {
     
    21652001  }
    21662002
    2167   /* deal with the case of trying change the filter color */
    2168   if (argc==4 && !strcmp(argv[2], "-c")) {
     2003  /* set the color */
     2004  while (i + 2 <= argc && (!strcmp(argv[i], "-c") ||
     2005                           !strcmp(argv[i], "-b"))) {
     2006    int color = owl_util_string_to_color(argv[i + 1]);
     2007    if (color == OWL_COLOR_INVALID) {
     2008      owl_function_error("The color '%s' is not available.", argv[i + 1]);
     2009    } else if (argv[i][1] == 'c') {
     2010      fgcolor = color;
     2011      set_fgcolor = true;
     2012    } else {
     2013      bgcolor = color;
     2014      set_bgcolor = true;
     2015    }
     2016    i += 2;
     2017  }
     2018
     2019  if (i > 2 && i == argc) {
    21692020    f=owl_global_get_filter(&g, argv[1]);
    21702021    if (!f) {
     
    21722023      return false;
    21732024    }
    2174     if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    2175       owl_function_error("The color '%s' is not available.", argv[3]);
     2025    if (!set_fgcolor && !set_bgcolor)
    21762026      return false;
    2177     }
    2178     owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3]));
    2179     owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    2180     return false;
    2181   }
    2182   if (argc==4 && !strcmp(argv[2], "-b")) {
    2183     f=owl_global_get_filter(&g, argv[1]);
    2184     if (!f) {
    2185       owl_function_error("The filter '%s' does not exist.", argv[1]);
    2186       return false;
    2187     }
    2188     if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    2189       owl_function_error("The color '%s' is not available.", argv[3]);
    2190       return false;
    2191     }
    2192     owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3]));
     2027    if (set_fgcolor)
     2028      owl_filter_set_fgcolor(f, fgcolor);
     2029    if (set_bgcolor)
     2030      owl_filter_set_bgcolor(f, bgcolor);
    21932031    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21942032    return true;
     
    21962034
    21972035  /* create the filter and check for errors */
    2198   f = owl_filter_new(argv[1], argc-2, argv+2);
     2036  f = owl_filter_new_colored(argv[1], argc - i, argv + i, fgcolor, bgcolor);
    21992037  if (f == NULL) {
    22002038    owl_function_error("Invalid filter: %s", argv[1]);
     
    24442282  if (f == NULL) {
    24452283    /* Couldn't make a filter for some reason. Return NULL. */
    2446     owl_function_error("Error creating filter '%s'", filtname);
    2447     g_free(filtname);
    2448     return NULL;
    2449   }
    2450 
    2451   /* add it to the global list */
    2452   owl_global_add_filter(&g, f);
    2453 
    2454   return(filtname);
    2455 }
    2456 
    2457 /* Create a filter for AIM IM messages to or from the specified
    2458  * screenname.  The name of the filter will be 'aimuser-<user>'.  If a
    2459  * filter already exists with this name, no new filter will be
    2460  * created.  This allows the configuration to override this function.
    2461  * Returns the name of the filter, which the caller must free.
    2462  */
    2463 CALLER_OWN char *owl_function_aimuserfilt(const char *user)
    2464 {
    2465   owl_filter *f;
    2466   char *argbuff, *filtname;
    2467   char *escuser;
    2468 
    2469   /* name for the filter */
    2470   filtname=g_strdup_printf("aimuser-%s", user);
    2471 
    2472   /* if it already exists then go with it.  This lets users override */
    2473   if (owl_global_get_filter(&g, filtname)) {
    2474     return filtname;
    2475   }
    2476 
    2477   /* create the new-internal filter */
    2478   escuser = owl_text_quote(user, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    2479 
    2480   argbuff = g_strdup_printf(
    2481       "( type ^aim$ and ( ( sender ^%1$s$ and recipient ^%2$s$ ) or "
    2482       "( sender ^%2$s$ and recipient ^%1$s$ ) ) )",
    2483       escuser, owl_global_get_aim_screenname_for_filters(&g));
    2484   g_free(escuser);
    2485 
    2486   f = owl_filter_new_fromstring(filtname, argbuff);
    2487   g_free(argbuff);
    2488 
    2489   if (f == NULL) {
    24902284    owl_function_error("Error creating filter '%s'", filtname);
    24912285    g_free(filtname);
     
    26042398 * If the curmsg is a zephyr class message and type==1 then
    26052399 *    return a filter name for the class and instance.
    2606  * If the curmsg is a personal AIM message returna  filter
    2607  *    name to the AIM conversation with that user
    26082400 */
    26092401CALLER_OWN char *owl_function_smartfilter(int type, int invert_related)
     
    26312423  if (owl_message_is_type_loopback(m)) {
    26322424    return(owl_function_typefilt("loopback"));
    2633   }
    2634 
    2635   /* aim messages */
    2636   if (owl_message_is_type_aim(m)) {
    2637     if (owl_message_is_direction_in(m)) {
    2638       filtname=owl_function_aimuserfilt(owl_message_get_sender(m));
    2639     } else if (owl_message_is_direction_out(m)) {
    2640       filtname=owl_function_aimuserfilt(owl_message_get_recipient(m));
    2641     }
    2642     return(filtname);
    26432425  }
    26442426
     
    30682850
    30692851/* Popup a buddylisting.  If filename is NULL use the default .anyone */
    3070 void owl_function_buddylist(int aim, int zephyr, const char *filename)
    3071 {
    3072   int i, j, idle;
     2852void owl_function_buddylist(int zephyr, const char *filename)
     2853{
     2854  int i;
    30732855  int interrupted = 0;
    30742856  owl_fmtext fm;
    3075   const owl_buddylist *bl;
    3076   const owl_buddy *b;
    3077   char *timestr;
    30782857#ifdef HAVE_LIBZEPHYR
    30792858  int x;
     
    30862865
    30872866  owl_fmtext_init_null(&fm);
    3088 
    3089   /* AIM first */
    3090   if (aim && owl_global_is_aimloggedin(&g)) {
    3091     bl=owl_global_get_buddylist(&g);
    3092 
    3093     owl_fmtext_append_bold(&fm, "AIM users logged in:\n");
    3094     /* we're assuming AIM for now */
    3095     j=owl_buddylist_get_size(bl);
    3096     for (i=0; i<j; i++) {
    3097       b=owl_buddylist_get_buddy_n(bl, i);
    3098       idle=owl_buddy_get_idle_time(b);
    3099       if (idle!=0) {
    3100         timestr=owl_util_format_minutes(idle);
    3101       } else {
    3102         timestr=g_strdup("");
    3103       }
    3104       owl_fmtext_appendf_normal(&fm, "  %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr);
    3105       g_free(timestr);
    3106     }
    3107   }
    31082867
    31092868#ifdef HAVE_LIBZEPHYR
     
    31622921#endif
    31632922
    3164   if (aim && zephyr) {
     2923  if (zephyr) {
    31652924    if (owl_perlconfig_is_function("BarnOwl::Hooks::_get_blist")) {
    31662925      char * perlblist = owl_perlconfig_execute("BarnOwl::Hooks::_get_blist()");
     
    34243183  char *date;
    34253184  time_t now;
     3185  struct tm tm;
    34263186  char *buff;
    34273187
    34283188  now = time(NULL);
    3429   date = owl_util_format_time(localtime(&now));
     3189  date = owl_util_format_time(localtime_r(&now, &tm));
    34303190
    34313191  buff = g_strdup_printf("%s %s", date, string);
     
    35053265}
    35063266
    3507 void owl_function_aimsearch_results(const char *email, GPtrArray *namelist)
    3508 {
    3509   owl_fmtext fm;
    3510   int i;
    3511 
    3512   owl_fmtext_init_null(&fm);
    3513   owl_fmtext_append_normal(&fm, "AIM screennames associated with ");
    3514   owl_fmtext_append_normal(&fm, email);
    3515   owl_fmtext_append_normal(&fm, ":\n");
    3516 
    3517   for (i = 0; i < namelist->len; i++) {
    3518     owl_fmtext_append_normal(&fm, "  ");
    3519     owl_fmtext_append_normal(&fm, namelist->pdata[i]);
    3520     owl_fmtext_append_normal(&fm, "\n");
    3521   }
    3522 
    3523   owl_function_popless_fmtext(&fm);
    3524   owl_fmtext_cleanup(&fm);
    3525 }
    3526 
    35273267int owl_function_get_color_count(void)
    35283268{
  • global.c

    r7dcef03 r4fd3c04  
    8484  _owl_global_init_windows(g);
    8585
    86   g->aim_screenname=NULL;
    87   g->aim_screenname_for_filters=NULL;
    88   g->aim_loggedin=0;
    89   owl_buddylist_init(&(g->buddylist));
    90 
    9186  g->havezephyr=0;
    92   g->haveaim=0;
    93   g->ignoreaimlogin=0;
    94   owl_global_set_no_doaimevents(g);
    9587
    9688  owl_errqueue_init(&(g->errqueue));
     
    646638}
    647639
    648 /* AIM stuff */
    649 
    650 int owl_global_is_aimloggedin(const owl_global *g)
    651 {
    652   if (g->aim_loggedin) return(1);
    653   return(0);
    654 }
    655 
    656 const char *owl_global_get_aim_screenname(const owl_global *g)
    657 {
    658   if (owl_global_is_aimloggedin(g)) {
    659     return (g->aim_screenname);
    660   }
    661   return("");
    662 }
    663 
    664 const char *owl_global_get_aim_screenname_for_filters(const owl_global *g)
    665 {
    666   if (owl_global_is_aimloggedin(g)) {
    667     return (g->aim_screenname_for_filters);
    668   }
    669   return("");
    670 }
    671 
    672 void owl_global_set_aimloggedin(owl_global *g, const char *screenname)
    673 {
    674   char *sn_escaped;
    675   g->aim_loggedin=1;
    676   if (g->aim_screenname) g_free(g->aim_screenname);
    677   if (g->aim_screenname_for_filters) g_free(g->aim_screenname_for_filters);
    678   g->aim_screenname=g_strdup(screenname);
    679   sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    680   g->aim_screenname_for_filters = owl_arg_quote(sn_escaped);
    681   g_free(sn_escaped);
    682 }
    683 
    684 void owl_global_set_aimnologgedin(owl_global *g)
    685 {
    686   g->aim_loggedin=0;
    687 }
    688 
    689 bool owl_global_is_doaimevents(const owl_global *g)
    690 {
    691   return g->aim_event_source != NULL;
    692 }
    693 
    694 void owl_global_set_doaimevents(owl_global *g)
    695 {
    696   if (g->aim_event_source)
    697     return;
    698   g->aim_event_source = owl_aim_event_source_new(owl_global_get_aimsess(g));
    699   g_source_attach(g->aim_event_source, NULL);
    700 }
    701 
    702 void owl_global_set_no_doaimevents(owl_global *g)
    703 {
    704   if (!g->aim_event_source)
    705     return;
    706   g_source_destroy(g->aim_event_source);
    707   g_source_unref(g->aim_event_source);
    708   g->aim_event_source = NULL;
    709 }
    710 
    711 aim_session_t *owl_global_get_aimsess(owl_global *g)
    712 {
    713   return(&(g->aimsess));
    714 }
    715 
    716 aim_conn_t *owl_global_get_bosconn(owl_global *g)
    717 {
    718   return(&(g->bosconn));
    719 }
    720 
    721 void owl_global_set_bossconn(owl_global *g, aim_conn_t *conn)
    722 {
    723   g->bosconn=*conn;
    724 }
    725 
    726640/* message queue */
    727641
     
    750664}
    751665
    752 owl_buddylist *owl_global_get_buddylist(owl_global *g)
    753 {
    754   return(&(g->buddylist));
    755 }
    756  
    757666/* style */
    758667
     
    781690  owl_dict_insert_element(&(g->styledict), owl_style_get_name(s),
    782691                          s, (void (*)(void *))owl_style_delete);
    783 }
    784 
    785 void owl_global_set_haveaim(owl_global *g)
    786 {
    787   g->haveaim=1;
    788 }
    789 
    790 int owl_global_is_haveaim(const owl_global *g)
    791 {
    792   if (g->haveaim) return(1);
    793   return(0);
    794 }
    795 
    796 void owl_global_set_ignore_aimlogin(owl_global *g)
    797 {
    798     g->ignoreaimlogin = 1;
    799 }
    800 
    801 void owl_global_unset_ignore_aimlogin(owl_global *g)
    802 {
    803     g->ignoreaimlogin = 0;
    804 }
    805 
    806 int owl_global_is_ignore_aimlogin(const owl_global *g)
    807 {
    808     return g->ignoreaimlogin;
    809692}
    810693
     
    867750    { "reply-lockout", "class ^mail$ or class ^filsrv$" },
    868751    { "out", "direction ^out$" },
    869     { "aim", "type ^aim$" },
    870752    { "zephyr", "type ^zephyr$" },
    871753    { "none", "false" },
  • help.c

    r8258ea5 r4fd3c04  
    5252     "\n"
    5353     "    z             Start a zwrite command\n"
    54      "    a             Start an aimwrite command\n"
    5554     "    r             Reply to the current message\n"
    5655     "    R             Reply to sender\n"
     
    6463     "    !             Invert the current view\n"
    6564     "\n"
    66      "    l             Print a zephyr/AIM buddy listing\n"
     65     "    l             Print a zephyr buddy listing\n"
    6766     "    A             Toggle away\n"
    6867     "    o             Toggle one-line display mode\n"
     
    8887     "\n"
    8988     "    zwrite        Send a zephyr\n"
    90      "    aimlogin      Login to AIM\n"
    91      "    aimwrite      Send an AIM message\n"
    9289     "\n"
    93      "    addbuddy      Add a zephyr or AIM buddy\n"
     90     "    addbuddy      Add a zephyr buddy\n"
    9491     "    zaway         Turn zaway on or off, or set the message\n"
    9592     "    zlocate       Locate a user\n"
    9693     "    subscribe     Subscribe to a zephyr class or instance\n"
    9794     "    unsubscribe   Unsubscribe to a zephyr class or instance\n"
    98      "    blist         Print a list of zephyr and AIM buddies logged in\n"
     95     "    blist         Print a list of zephyr buddies logged in\n"
    9996     "    search        Search for a text string\n"
    10097     "\n"
     
    110107     "    zlog          Send a login or logout notification\n"
    111108     "    zlist         Print a list of zephyr buddies logged in\n"
    112      "    alist         Print a list of AIM buddies logged in\n"
    113109     "    info          Print detailed information about the current message\n"
    114110     "    filter        Create a message filter\n"
  • keys.c

    rdcd48ad r4fd3c04  
    4444  BIND_CMD("M-RIGHT",     "edit:move-next-word", "");
    4545  BIND_CMD("M-[ 1 ; 3 D", "edit:move-next-word", "");
     46  BIND_CMD("M-[ 1 ; 5 D", "edit:move-next-word", "");
    4647  BIND_CMD("M-b",         "edit:move-prev-word", "");
    4748  BIND_CMD("M-O 3 D",     "edit:move-prev-word", "");
    4849  BIND_CMD("M-LEFT",      "edit:move-prev-word", "");
    49   BIND_CMD("M-[ 1 ; 3 C", "edit:move-next-word", "");
     50  BIND_CMD("M-[ 1 ; 3 C", "edit:move-prev-word", "");
     51  BIND_CMD("M-[ 1 ; 5 C", "edit:move-prev-word", "");
    5052
    5153  BIND_CMD("LEFT",        "edit:move-left", "");
     
    315317
    316318  BIND_CMD("z",   "start-command zwrite ", "start a zwrite command");
    317   BIND_CMD("a",   "start-command aimwrite ", "start an aimwrite command");
    318319  BIND_CMD("r",   "reply",            "reply to the current message");
    319320  BIND_CMD("R",   "reply sender",     "reply to sender of the current message");
  • logging.c

    r4ead7b3 r0c059f0  
    3030static void owl_log_makemsg_main_thread(gpointer data)
    3131{
    32   owl_function_makemsg((const char*)data);
     32  owl_function_makemsg("%s", (const char*)data);
    3333}
    3434
     
    105105}
    106106
    107 static void owl_log_entry_free(void *data)
     107static void owl_log_entry_delete(void *data)
    108108{
    109109  owl_log_entry *msg = (owl_log_entry*)data;
    110   if (msg) {
    111     g_free(msg->message);
    112     g_free(msg->filename);
    113     g_slice_free(owl_log_entry, msg);
    114   }
     110  g_free(msg->message);
     111  g_free(msg->filename);
     112  g_slice_free(owl_log_entry, msg);
    115113}
    116114
    117115#if GLIB_CHECK_VERSION(2, 32, 0)
    118116#else
    119 static void owl_log_entry_free_gfunc(gpointer data, gpointer user_data)
    120 {
    121   owl_log_entry_free(data);
     117static void owl_log_entry_delete_gfunc(gpointer data, gpointer user_data)
     118{
     119  owl_log_entry_delete(data);
    122120}
    123121#endif
     
    204202      }
    205203    }
    206     owl_log_entry_free(entry);
     204    owl_log_entry_delete(entry);
    207205  }
    208206  if (logged_message_count > 0) {
     
    242240  owl_log_entry *log_msg = owl_log_new_entry(buffer, filename);
    243241  owl_select_post_task(owl_log_eventually_write_entry, log_msg,
    244                        owl_log_entry_free, log_context);
     242                       owl_log_entry_delete, log_context);
    245243}
    246244
     
    296294  owl_log_write_deferred_entries(&opts);
    297295#if GLIB_CHECK_VERSION(2, 32, 0)
    298   g_queue_free_full(deferred_entry_queue, owl_log_entry_free);
     296  g_queue_free_full(deferred_entry_queue, owl_log_entry_delete);
    299297#else
    300   g_queue_foreach(deferred_entry_queue, owl_log_entry_free_gfunc, NULL);
     298  g_queue_foreach(deferred_entry_queue, owl_log_entry_delete_gfunc, NULL);
    301299  g_queue_free(deferred_entry_queue);
    302300#endif
  • message.c

    rff528e6 r4fd3c04  
    3030void owl_message_init(owl_message *m)
    3131{
     32  /* ctime_r requires a 26-byte buffer */
     33  char timestr[26];
     34
    3235  m->id=owl_global_get_nextmsgid(&g);
    3336  owl_message_set_direction_none(m);
     
    4346  /* save the time */
    4447  m->time = time(NULL);
    45   m->timestr = g_strdup(ctime(&m->time));
    46   m->timestr[strlen(m->timestr)-1] = '\0';
     48  ctime_r(&m->time, timestr);
     49  m->timestr = g_strndup(timestr, strlen(timestr) - 1);
    4750
    4851  m->fmtext = NULL;
     
    349352CALLER_OWN char *owl_message_format_time(const owl_message *m)
    350353{
    351   return owl_util_format_time(localtime(&m->time));
     354  struct tm tm;
     355  return owl_util_format_time(localtime_r(&m->time, &tm));
    352356}
    353357
     
    365369{
    366370  owl_message_set_attribute(m, "type", "zephyr");
    367 }
    368 
    369 void owl_message_set_type_aim(owl_message *m)
    370 {
    371   owl_message_set_attribute(m, "type", "AIM");
    372371}
    373372
     
    391390{
    392391  return owl_message_is_type(m, "zephyr");
    393 }
    394 
    395 int owl_message_is_type_aim(const owl_message *m)
    396 {
    397   return owl_message_is_type(m, "aim");
    398392}
    399393
     
    593587CALLER_OWN GList *owl_message_get_cc_without_recipient(const owl_message *m)
    594588{
    595   char *cc, *shortuser, *recip;
     589  char *cc, *shortuser, *recip, *saveptr;
    596590  const char *user;
    597591  GList *out = NULL;
     
    603597  recip = short_zuser(owl_message_get_recipient(m));
    604598
    605   user = strtok(cc, " ");
     599  user = strtok_r(cc, " ", &saveptr);
    606600  while (user != NULL) {
    607601    shortuser = short_zuser(user);
     
    610604    }
    611605    g_free(shortuser);
    612     user = strtok(NULL, " ");
     606    user = strtok_r(NULL, " ", &saveptr);
    613607  }
    614608
     
    683677
    684678
    685 /* if loginout == -1 it's a logout message
    686  *                 0 it's not a login/logout message
    687  *                 1 it's a login message
    688  */
    689 void owl_message_create_aim(owl_message *m, const char *sender, const char *recipient, const char *text, int direction, int loginout)
    690 {
    691   owl_message_init(m);
    692   owl_message_set_body(m, text);
    693   owl_message_set_sender(m, sender);
    694   owl_message_set_recipient(m, recipient);
    695   owl_message_set_type_aim(m);
    696 
    697   if (direction==OWL_MESSAGE_DIRECTION_IN) {
    698     owl_message_set_direction_in(m);
    699   } else if (direction==OWL_MESSAGE_DIRECTION_OUT) {
    700     owl_message_set_direction_out(m);
    701   }
    702 
    703   /* for now all messages that aren't loginout are private */
    704   if (!loginout) {
    705     owl_message_set_isprivate(m);
    706   }
    707 
    708   if (loginout==-1) {
    709     owl_message_set_islogout(m);
    710   } else if (loginout==1) {
    711     owl_message_set_islogin(m);
    712   }
    713 }
    714 
    715679void owl_message_create_admin(owl_message *m, const char *header, const char *text)
    716680{
     
    775739  struct hostent *hent;
    776740#endif /* ZNOTICE_SOCKADDR */
    777   char *tmp, *tmp2;
     741  /* ctime_r requires a 26-byte buffer */
     742  char timestr[26], *tmp, *tmp2;
    778743  int len;
    779744
     
    793758  if (m->timestr) g_free(m->timestr);
    794759  m->time = n->z_time.tv_sec;
    795   m->timestr = g_strdup(ctime(&m->time));
    796   m->timestr[strlen(m->timestr)-1] = '\0';
     760  ctime_r(&m->time, timestr);
     761  m->timestr = g_strndup(timestr, strlen(timestr) - 1);
    797762
    798763  /* set other info */
  • owl.c

    r4ead7b3 r4fd3c04  
    187187      if (owl_message_is_type_zephyr(m)) {
    188188        owl_zephyr_zaway(m);
    189       } else if (owl_message_is_type_aim(m)) {
    190         if (owl_message_is_private(m)) {
    191           owl_function_send_aimawymsg(owl_message_get_sender(m), owl_global_get_zaway_msg(&g));
    192         }
    193189      }
    194190    }
     
    504500  owl_global_set_startupargs(&g, argc_copy, argv_copy);
    505501  g_strfreev(argv_copy);
    506   owl_global_set_haveaim(&g);
    507502
    508503  owl_register_signal_handlers();
     
    564559                  owl_global_get_filter(&g, "all"),
    565560                  owl_global_get_style_by_name(&g, "default"));
    566 
    567   /* AIM init */
    568   owl_function_debugmsg("startup: doing AIM initialization");
    569   owl_aim_init();
    570561
    571562  /* execute the startup function in the configfile */
  • owl.h

    rca1fb26a r4fd3c04  
    3535#include <termios.h>
    3636#include <unistd.h>
    37 #include "libfaim/aim.h"
    3837#include <wchar.h>
    3938#include <glib.h>
     
    108107#define OWL_EDITWIN_STYLE_MULTILINE 0
    109108#define OWL_EDITWIN_STYLE_ONELINE   1
    110 
    111 #define OWL_PROTOCOL_ZEPHYR         0
    112 #define OWL_PROTOCOL_AIM            1
    113 #define OWL_PROTOCOL_JABBER         2
    114 #define OWL_PROTOCOL_ICQ            3
    115 #define OWL_PROTOCOL_YAHOO          4
    116 #define OWL_PROTOCOL_MSN            5
    117109
    118110#define OWL_MESSAGE_DIRECTION_NONE  0
     
    178170
    179171#define OWL_DEFAULT_ZAWAYMSG    "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
    180 #define OWL_DEFAULT_AAWAYMSG    "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
    181172
    182173#define OWL_CMD_ALIAS_SUMMARY_PREFIX "command alias to: "
     
    492483  int       kpstackpos;         /* location in stack (-1 = none) */
    493484} owl_keyhandler;
    494 
    495 typedef struct _owl_buddy {
    496   int proto;
    497   char *name;
    498   int isidle;
    499   int idlesince;
    500 } owl_buddy;
    501 
    502 typedef struct _owl_buddylist {
    503   GPtrArray *buddies;
    504 } owl_buddylist;
    505485
    506486typedef struct _owl_zbuddylist {
     
    569549  pid_t newmsgproc_pid;
    570550  owl_regex search_re;
    571   aim_session_t aimsess;
    572   aim_conn_t bosconn;
    573   int aim_loggedin;         /* true if currently logged into AIM */
    574   GSource *aim_event_source; /* where we get our AIM events from */
    575   char *aim_screenname;     /* currently logged in AIM screen name */
    576   char *aim_screenname_for_filters;     /* currently logged in AIM screen name */
    577   owl_buddylist buddylist;  /* list of logged in AIM buddies */
    578   GQueue *messagequeue;     /* for queueing up aim and other messages */
     551  GQueue *messagequeue;     /* for queueing up messages */
    579552  owl_dict styledict;       /* global dictionary of available styles */
    580553  char *response;           /* response to the last question asked */
    581554  int havezephyr;
    582   int haveaim;
    583   int ignoreaimlogin;
    584555  owl_zbuddylist zbuddies;
    585556  GList *zaldlist;
    586557  int pseudologin_notify;
    587558  struct termios startup_tio;
    588   guint aim_nop_timer;
    589559  int load_initial_subs;
    590560  FILE *debug_file;
  • perl/Makefile.am

    reea7bed4 r4fd3c04  
    22nobase_dist_pkgdata_DATA = \
    33        lib/BarnOwl.pm \
    4         lib/BarnOwl/Complete/AIM.pm \
    54        lib/BarnOwl/Complete/Client.pm \
    65        lib/BarnOwl/Complete/Filter.pm \
     
    1716        lib/BarnOwl/MainLoopCompatHook.pm \
    1817        lib/BarnOwl/Message.pm \
    19         lib/BarnOwl/Message/AIM.pm \
    2018        lib/BarnOwl/Message/Admin.pm \
    2119        lib/BarnOwl/Message/Generic.pm \
  • perl/lib/BarnOwl/Complete/Filter.pm

    r6dba228 r4fd3c04  
    3636    body      => undef,
    3737    hostname  => undef,
    38     type      => sub { qw(zephyr aim admin); },
     38    type      => sub { qw(zephyr admin); },
    3939    direction => sub { qw(in out none); },
    4040    login     => sub { qw(login logout none); },
  • perl/lib/BarnOwl/Logging.pm

    rb807d8f r4fd3c04  
    7575            summary     => 'enable logging of login notifications',
    7676            description => "When this is enabled, BarnOwl will log login and logout notifications\n"
    77                          . "for AIM, zephyr, or other protocols.  If disabled BarnOwl will not log\n"
     77                         . "for zephyr or other protocols.  If disabled BarnOwl will not log\n"
    7878                         . "login or logout notifications."
    7979        });
  • perl/lib/BarnOwl/Message.pm

    r5dee79a r4fd3c04  
    77
    88use BarnOwl::Message::Admin;
    9 use BarnOwl::Message::AIM;
    109use BarnOwl::Message::Generic;
    1110use BarnOwl::Message::Loopback;
     
    4342sub is_generic  { return (shift->{"type"} eq "generic"); }
    4443sub is_zephyr   { return (shift->{"type"} eq "zephyr"); }
    45 sub is_aim      { return (shift->{"type"} eq "AIM"); }
     44sub is_aim      { return ''; }
    4645sub is_jabber   { return (shift->{"type"} eq "jabber"); }
    4746sub is_icq      { return (shift->{"type"} eq "icq"); }
  • perlconfig.c

    r7dcef03 r09530e6  
    211211      g_free(m->timestr);
    212212      m->timestr = g_strdup(val);
     213      // FIXME: Daylight saving time will be guessed wrongly one hour per year!
     214      tm.tm_isdst = -1;
    213215      strptime(val, "%a %b %d %T %Y", &tm);
    214216      m->time = mktime(&tm);
  • t/completion.t

    re59d775 r4fd3c04  
    66
    77use File::Basename;
    8 BEGIN {require (dirname($0) . "/mock.pl");};
     8use File::Spec;
     9BEGIN {require File::Spec->rel2abs("mock.pl", dirname($0));};
    910
    1011use BarnOwl::Complete::Filter qw(complete_filter_expr);
     
    292293
    293294test_complete('type ', '',
    294               [qw[admin aim zephyr]],
     295              [qw[admin zephyr]],
    295296              \&complete_filter_expr);
    296297
  • tester.c

    r03fbf66 ra882637  
    8282    sv_setpv(get_sv("main::test_prog", TRUE), argv[1]);
    8383
    84     eval_pv("do $main::test_prog; die($@) if($@)", true);
    85   }
    86 
    87   status = 0;
     84    eval_pv("use File::Spec; do File::Spec->rel2abs($main::test_prog); die($@) if($@)", true);
     85  }
    8886
    8987  FREETMPS;
  • variable.c

    r03fbf66 r4fd3c04  
    161161               "Enable printing of login notifications",
    162162               "When this is enabled, BarnOwl will print login and logout notifications\n"
    163                "for AIM, zephyr, or other protocols.  If disabled BarnOwl will not print\n"
     163               "for zephyr or other protocols.  If disabled BarnOwl will not print\n"
    164164               "login or logout notifications.\n");
    165165
     
    233233                 "default zaway message", "" );
    234234
    235   OWLVAR_BOOL_FULL( "aaway" /* %OwlVarStub */, 0,
    236                     "Set AIM away status",
    237                     "",
    238                     NULL, owl_variable_aaway_set, NULL);
    239 
    240   OWLVAR_STRING( "aaway_msg" /* %OwlVarStub */,
    241                  OWL_DEFAULT_AAWAYMSG,
    242                  "AIM away msg for responding when away", "" );
    243 
    244   OWLVAR_STRING( "aaway_msg_default" /* %OwlVarStub */,
    245                  OWL_DEFAULT_AAWAYMSG,
    246                  "default AIM away message", "" );
    247 
    248235  OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all",
    249236                 "home view to switch to after 'X' and 'V'",
     
    288275                 "Zephyr messages be no wider than 70 columns.\n");
    289276
    290   OWLVAR_INT( "aim_ignorelogin_timer" /* %OwlVarStub */, 15,
    291               "number of seconds after AIM login to ignore login messages",
    292               "This specifies the number of seconds to wait after an\n"
    293               "AIM login before allowing the receipt of AIM login notifications.\n"
    294               "By default this is set to 15.  If you would like to view login\n"
    295               "notifications of buddies as soon as you login, set it to 0 instead.");
    296 
    297              
    298277  OWLVAR_INT_FULL( "typewinsize" /* %OwlVarStub:typwin_lines */,
    299278                   OWL_TYPWIN_SIZE,
     
    461440}
    462441
    463 /* When 'aaway' is changed, need to notify the AIM server */
    464 int owl_variable_aaway_set(owl_variable *v, bool newval)
    465 {
    466   if (newval) {
    467     owl_aim_set_awaymsg(owl_global_get_aaway_msg(&g));
    468   } else {
    469     owl_aim_set_awaymsg("");
    470   }
    471   return owl_variable_bool_set_default(v, newval);
    472 }
    473 
    474442int owl_variable_colorztext_set(owl_variable *v, bool newval)
    475443{
  • zcrypt.c

    rca1fb26a r9a0d25d  
    2121#include <config.h>
    2222
    23 #ifdef HAVE_KERBEROS_IV
    24 #include <kerberosIV/des.h>
    25 #else
    2623#include <openssl/des.h>
    27 #endif
    2824
    2925#include "filterproc.h"
     
    9995};
    10096
    101 static void owl_zcrypt_string_to_schedule(char *keystring, des_key_schedule *schedule) {
    102 #ifdef HAVE_KERBEROS_IV
    103   des_cblock key;
    104 #else
    105   des_cblock _key, *key = &_key;
    106 #endif
    107 
    108   des_string_to_key(keystring, key);
    109   des_key_sched(key, *schedule);
     97static void owl_zcrypt_string_to_schedule(char *keystring, DES_key_schedule *schedule) {
     98  DES_cblock key;
     99
     100  DES_string_to_key(keystring, &key);
     101  DES_key_sched(&key, schedule);
    110102}
    111103
     
    728720int do_encrypt_des(const char *keyfile, const char *in, int length, FILE *outfile)
    729721{
    730   des_key_schedule schedule;
     722  DES_key_schedule schedule;
    731723  unsigned char input[8], output[8];
    732724  const char *inptr;
     
    774766
    775767    /* Encrypt and output the block */
    776     des_ecb_encrypt(&input, &output, schedule, TRUE);
     768    DES_ecb_encrypt(&input, &output, &schedule, TRUE);
    777769    block_to_ascii(output, outfile);
    778770
     
    790782  char *out;
    791783  int err, status;
     784  int tried_gpg1 = FALSE;
    792785  const char *argv[] = {
    793     "gpg",
     786    "gpg1",
    794787    "--symmetric",
    795788    "--no-options",
     
    805798    NULL
    806799  };
    807   err = call_filter(argv, in, &out, &status);
     800  while ((err = call_filter(argv, in, &out, &status)) && !out && !tried_gpg1) {
     801    tried_gpg1 = TRUE;
     802    argv[0] = "gpg";
     803  }
    808804  if(err || status) {
    809805    g_free(out);
     
    874870  char *in, *out;
    875871  int length;
     872  int tried_gpg1 = FALSE;
    876873  const char *argv[] = {
    877     "gpg",
     874    "gpg1",
    878875    "--decrypt",
    879876    "--no-options",
     
    892889  if(!in) return FALSE;
    893890
    894   err = call_filter(argv, in, &out, &status);
     891  while ((err = call_filter(argv, in, &out, &status)) && !out && !tried_gpg1) {
     892    tried_gpg1 = TRUE;
     893    argv[0] = "gpg";
     894  }
    895895  free(in);
    896896  if(err || status) {
     
    905905
    906906int do_decrypt_des(const char *keyfile) {
    907   des_key_schedule schedule;
     907  DES_key_schedule schedule;
    908908  unsigned char input[8], output[8];
    909909  char tmp[9];
     
    915915    have a NULL-terminated string we can call printf/strlen on.
    916916
    917     We don't pass 'tmp' to des_ecb_encrypt directly, because it's
     917    We don't pass 'tmp' to DES_ecb_encrypt directly, because it's
    918918    prototyped as taking 'unsigned char[8]', and this avoids a stupid
    919919    cast.
     
    933933  while (read_ascii_block(input))
    934934  {
    935     des_ecb_encrypt(&input, &output, schedule, FALSE);
     935    DES_ecb_encrypt(&input, &output, &schedule, FALSE);
    936936    memcpy(tmp, output, 8);
    937937    printf("%s", tmp);
  • zephyr.c

    rff58239 ree6b30f  
    284284  FILE *file;
    285285  int fopen_errno;
    286   char *tmp, *start;
     286  char *tmp, *start, *saveptr;
    287287  char *buffer = NULL;
    288288  char *subsfile;
     
    319319   
    320320    /* add it to the list of subs */
    321     if ((tmp = strtok(start, ",\n\r")) == NULL)
     321    if ((tmp = strtok_r(start, ",\n\r", &saveptr)) == NULL)
    322322      continue;
    323323    subs[count].zsub_class = g_strdup(tmp);
    324     if ((tmp=strtok(NULL, ",\n\r")) == NULL)
     324    if ((tmp = strtok_r(NULL, ",\n\r", &saveptr)) == NULL)
    325325      continue;
    326326    subs[count].zsub_classinst = g_strdup(tmp);
    327     if ((tmp = strtok(NULL, " \t\n\r")) == NULL)
     327    if ((tmp = strtok_r(NULL, " \t\n\r", &saveptr)) == NULL)
    328328      continue;
    329329    subs[count].zsub_recipient = g_strdup(tmp);
  • zwrite.c

    r7dcef03 r1958790  
    270270  rv = owl_zwrite_create_from_line(&z, cmd);
    271271  if (rv != 0) return rv;
    272   if (!owl_zwrite_is_message_set(&z)) {
    273     owl_zwrite_set_message(&z, msg);
    274   }
    275   owl_zwrite_populate_zsig(&z);
    276   owl_zwrite_send_message(&z);
     272  owl_function_zwrite(&z, msg);
    277273  owl_zwrite_cleanup(&z);
    278274  return(0);
Note: See TracChangeset for help on using the changeset viewer.