Changeset 3ef779b for zephyr.c


Ignore:
Timestamp:
May 26, 2009, 10:32:00 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:
1e550b2
Parents:
7451af9
git-author:
Alexander W Dehnert <adehnert@mit.edu> (05/25/09 20:19:00)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/26/09 22:32:00)
Message:
Send instanced pings and give useful error messages

Based on discussion on -c barnowl, switches

zwrite adehnert => ping
zwrite adehnert -i test => no ping
zwrite adehnert -c test => no ping

to

zwrite adehnert => ping
zwrite adehnert -i test => ping
zwrite adehnert -c test => no ping

Pings match the class & instance of the
message they are associated with.

The error message when an instanced personal
fails now includes the instance.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r7451af9 r3ef779b  
    719719#endif
    720720
    721 void send_ping(char *to)
    722 {
    723 #ifdef HAVE_LIBZEPHYR
    724   send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, "");
     721void send_ping(char *to, char *zclass, char *zinstance)
     722{
     723#ifdef HAVE_LIBZEPHYR
     724  send_zephyr("PING", "", zclass, zinstance, to, "");
    725725#endif
    726726}
     
    772772      tmp = short_zuser(retnotice->z_recipient);
    773773      owl_function_error("%s: Not logged in or subscribing.", tmp);
    774       if(strcmp(retnotice->z_class, "message")) {
     774      /*
     775       * These error messages are often over 80 chars, but users who want to
     776       * see the whole thing can scroll to the side, and for those with wide
     777       * terminals or who don't care, not splitting saves a line in the UI
     778       */
     779      if(strcasecmp(retnotice->z_class, "message")) {
    775780        snprintf(buff, BUFFLEN,
    776781                 "Could not send message to %s: "
    777                  "not logged in or subscribing to class %s, instance %s.\n", 
     782                 "not logged in or subscribing to class %s, instance %s.\n",
    778783                 tmp,
    779784                 retnotice->z_class,
     785                 retnotice->z_class_inst);
     786      } else if(strcasecmp(retnotice->z_class_inst, "personal")) {
     787        snprintf(buff, BUFFLEN,
     788                 "Could not send message to %s: "
     789                 "not logged in or subscribing to instance %s.\n",
     790                 tmp,
    780791                 retnotice->z_class_inst);
    781792      } else {
Note: See TracChangeset for help on using the changeset viewer.