Changeset 31e48a3


Ignore:
Timestamp:
Jun 1, 2003, 2:42:58 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
df0d93a
Parents:
0ff8fb57
Message:
Do ZResetAuthentication() before zlog_in and zlog_out as well
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rd09e5a1 r31e48a3  
    7373        Added basic AIM support, including the "aimlogin", "aimwrite" and
    7474           "aimlogout" commands
     75        New built-in filters 'aim' and 'zephyr'.
     76        Do ZResetAuthentication() before zlog_in and zlog_out as well.
    7577       
    76781.2.8
  • commands.c

    r0ff8fb57 r31e48a3  
    12361236      owl_global_set_tty(&g, argv[2]);
    12371237    }
    1238     owl_function_zlog_in();
     1238    owl_zephyr_zlog_in();
    12391239  } else if (!strcmp(argv[1], "out")) {
    12401240    if (argc!=2) {
     
    12421242      return(NULL);
    12431243    }
    1244     owl_function_zlog_out();
     1244    owl_zephyr_zlog_out();
    12451245  } else {
    12461246    owl_function_makemsg("Invalid subcommand for zlog");
     
    12501250
    12511251
    1252 void owl_command_zlog_out() {
    1253   owl_function_zlog_out();
     1252void owl_command_zlog_out(void) {
     1253  owl_zephyr_zlog_out();
    12541254}
    12551255
  • functions.c

    r0ff8fb57 r31e48a3  
    693693  /* zlog out if we need to */
    694694  if (owl_global_is_shutdownlogout(&g)) {
    695     owl_function_zlog_out();
     695    owl_zephyr_zlog_out();
    696696  }
    697697
     
    711711  owl_function_debugmsg("Quitting Owl");
    712712  exit(0);
    713 }
    714 
    715 
    716 void owl_function_zlog_in()
    717 {
    718   char *exposure, *eset;
    719   int ret;
    720 
    721   eset=EXPOSE_REALMVIS;
    722   exposure=ZGetVariable("exposure");
    723   if (exposure==NULL) {
    724     eset=EXPOSE_REALMVIS;
    725   } else if (!strcasecmp(exposure,EXPOSE_NONE)) {
    726     eset = EXPOSE_NONE;
    727   } else if (!strcasecmp(exposure,EXPOSE_OPSTAFF)) {
    728     eset = EXPOSE_OPSTAFF;
    729   } else if (!strcasecmp(exposure,EXPOSE_REALMVIS)) {
    730     eset = EXPOSE_REALMVIS;
    731   } else if (!strcasecmp(exposure,EXPOSE_REALMANN)) {
    732     eset = EXPOSE_REALMANN;
    733   } else if (!strcasecmp(exposure,EXPOSE_NETVIS)) {
    734     eset = EXPOSE_NETVIS;
    735   } else if (!strcasecmp(exposure,EXPOSE_NETANN)) {
    736     eset = EXPOSE_NETANN;
    737   }
    738    
    739   ret=ZSetLocation(eset);
    740   if (ret != ZERR_NONE) {
    741     /*
    742       char buff[LINE];
    743       sprintf(buff, "Error setting location: %s", error_message(ret));
    744       owl_function_makemsg(buff);
    745     */
    746   }
    747 }
    748 
    749 void owl_function_zlog_out()
    750 {
    751   int ret;
    752  
    753   ret=ZUnsetLocation();
    754   if (ret != ZERR_NONE) {
    755     /*
    756       char buff[LINE];
    757       sprintf(buff, "Error unsetting location: %s", error_message(ret));
    758       owl_function_makemsg(buff);
    759     */
    760   }
    761713}
    762714
  • owl.c

    rd09e5a1 r31e48a3  
    167167
    168168  f=malloc(sizeof(owl_filter));
     169  owl_filter_init_fromstring(f, "aim", "type ^aim$");
     170  owl_list_append_element(owl_global_get_filterlist(&g), f);
     171
     172  f=malloc(sizeof(owl_filter));
     173  owl_filter_init_fromstring(f, "zephyr", "type ^zephyr$");
     174  owl_list_append_element(owl_global_get_filterlist(&g), f);
     175
     176  f=malloc(sizeof(owl_filter));
    169177  owl_filter_init_fromstring(f, "none", "false");
    170178  owl_list_append_element(owl_global_get_filterlist(&g), f);
     
    212220  /* zlog in if we need to */
    213221  if (owl_global_is_startuplogin(&g)) {
    214     owl_function_zlog_in();
     222    owl_zephyr_zlog_in();
    215223  }
    216224
  • owl_prototypes.h

    r0ff8fb57 r31e48a3  
    8080extern char *owl_command_term(int argc, char **argv, char *buff);
    8181extern char *owl_command_zlog(int argc, char **argv, char *buff);
    82 extern void owl_command_zlog_out();
     82extern void owl_command_zlog_out(void);
    8383extern char *owl_command_subscribe(int argc, char **argv, char *buff);
    8484extern char *owl_command_unsubscribe(int argc, char **argv, char *buff);
     
    309309extern void owl_function_zaway_off();
    310310extern void owl_function_quit();
    311 extern void owl_function_zlog_in();
    312 extern void owl_function_zlog_out();
    313311extern void owl_function_makemsg(char *fmt, ...);
    314312extern void owl_function_errormsg(char *fmt, ...);
     
    931929extern void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip);
    932930extern char *owl_zephyr_makesubline(char *class, char *inst, char *recip);
     931extern void owl_zephyr_zlog_in(void);
     932extern void owl_zephyr_zlog_out(void);
    933933
    934934/* -------------------------------- zwrite.c -------------------------------- */
  • zephyr.c

    r8262340 r31e48a3  
    1212Code_t ZResetAuthentication();
    1313
    14 int owl_zephyr_loadsubs(char *filename) {
     14int owl_zephyr_loadsubs(char *filename)
     15{
    1516  /* return 0  on success
    1617   *        -1 on file error
     
    8485}
    8586
    86 int owl_zephyr_loadloginsubs(char *filename) {
     87int owl_zephyr_loadloginsubs(char *filename)
     88{
    8789  FILE *file;
    8890  ZSubscription_t subs[3001];
     
    139141}
    140142
    141 void unsuball() {
     143void unsuball()
     144{
    142145  int ret;
    143146
     
    149152}
    150153
    151 int owl_zephyr_sub(char *class, char *inst, char *recip) {
     154int owl_zephyr_sub(char *class, char *inst, char *recip)
     155{
    152156  ZSubscription_t subs[5];
    153157  int ret;
     
    166170
    167171
    168 int owl_zephyr_unsub(char *class, char *inst, char *recip) {
     172int owl_zephyr_unsub(char *class, char *inst, char *recip)
     173{
    169174  ZSubscription_t subs[5];
    170175  int ret;
     
    183188
    184189
    185 char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k) {
     190char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k)
     191{
    186192  /* return a pointer to the Jth field, place the length in k.  If the
    187193     field doesn't exist return an emtpy string */
     
    212218
    213219
    214 int owl_zephyr_get_num_fields(ZNotice_t *n) {
     220int owl_zephyr_get_num_fields(ZNotice_t *n)
     221{
    215222  int i, fields;
    216223
     
    224231
    225232
    226 char *owl_zephyr_get_message(ZNotice_t *n, int *k) {
     233char *owl_zephyr_get_message(ZNotice_t *n, int *k)
     234{
    227235  /* return a pointer to the message, place the message length in k */
    228236  if (!strcasecmp(n->z_opcode, "ping")) {
     
    235243
    236244
    237 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k) {
     245char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
     246{
    238247  /* return a pointer to the zsig if there is one */
    239248
     
    247256
    248257
    249 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message) {
     258int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
     259{
    250260  int ret;
    251261  ZNotice_t notice;
     
    287297}
    288298
    289 Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait) {
     299Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait)
     300{
    290301  return(ZSendPacket(buf, len, 0));
    291302}
    292303
    293 void send_ping(char *to) {
     304void send_ping(char *to)
     305{
    294306  send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, "");
    295307}
    296308
    297 void owl_zephyr_handle_ack(ZNotice_t *retnotice) {
     309void owl_zephyr_handle_ack(ZNotice_t *retnotice)
     310{
    298311  char *tmp;
    299312 
     
    331344}
    332345
    333 int owl_zephyr_notice_is_ack(ZNotice_t *n) {
     346int owl_zephyr_notice_is_ack(ZNotice_t *n)
     347{
    334348  if (n->z_kind == SERVNAK || n->z_kind == SERVACK || n->z_kind == HMACK) {
    335349    if (!strcasecmp(n->z_class, LOGIN_CLASS)) return(0);
     
    339353}
    340354 
    341 void owl_zephyr_zaway(owl_message *m) {
     355void owl_zephyr_zaway(owl_message *m)
     356{
    342357  char *tmpbuff, *myuser, *to;
    343358 
     
    380395
    381396
    382 void owl_zephyr_hackaway_cr(ZNotice_t *n) {
     397void owl_zephyr_hackaway_cr(ZNotice_t *n)
     398{
    383399  /* replace \r's with ' '.  Gross-ish */
    384400  int i;
     
    391407}
    392408
    393 void owl_zephyr_zlocate(char *user, char *out, int auth) {
     409void owl_zephyr_zlocate(char *user, char *out, int auth)
     410{
    394411  int ret, numlocs;
    395412  int one = 1;
     
    419436}
    420437
    421 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip) {
     438void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip)
     439{
    422440  char *line, subsfile[LINE], buff[LINE];
    423441  FILE *file;
     
    461479}
    462480
    463 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip) {
     481void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip)
     482{
    464483  char *line, subsfile[LINE], buff[LINE], *text;
    465484  char backupfilename[LINE];
     
    527546}
    528547
    529 char *owl_zephyr_makesubline(char *class, char *inst, char *recip) {
     548char *owl_zephyr_makesubline(char *class, char *inst, char *recip)
     549{
    530550  /* caller must free the return */
    531551  char *out;
     
    535555  return(out);
    536556}
     557
     558
     559void owl_zephyr_zlog_in(void)
     560{
     561  char *exposure, *eset;
     562  int ret;
     563
     564  ZResetAuthentication();
     565   
     566  eset=EXPOSE_REALMVIS;
     567  exposure=ZGetVariable("exposure");
     568  if (exposure==NULL) {
     569    eset=EXPOSE_REALMVIS;
     570  } else if (!strcasecmp(exposure,EXPOSE_NONE)) {
     571    eset = EXPOSE_NONE;
     572  } else if (!strcasecmp(exposure,EXPOSE_OPSTAFF)) {
     573    eset = EXPOSE_OPSTAFF;
     574  } else if (!strcasecmp(exposure,EXPOSE_REALMVIS)) {
     575    eset = EXPOSE_REALMVIS;
     576  } else if (!strcasecmp(exposure,EXPOSE_REALMANN)) {
     577    eset = EXPOSE_REALMANN;
     578  } else if (!strcasecmp(exposure,EXPOSE_NETVIS)) {
     579    eset = EXPOSE_NETVIS;
     580  } else if (!strcasecmp(exposure,EXPOSE_NETANN)) {
     581    eset = EXPOSE_NETANN;
     582  }
     583   
     584  ret=ZSetLocation(eset);
     585  if (ret != ZERR_NONE) {
     586    /*
     587      char buff[LINE];
     588      sprintf(buff, "Error setting location: %s", error_message(ret));
     589      owl_function_makemsg(buff);
     590    */
     591  }
     592}
     593
     594void owl_zephyr_zlog_out(void)
     595{
     596  int ret;
     597
     598  ZResetAuthentication();
     599  ret=ZUnsetLocation();
     600  if (ret != ZERR_NONE) {
     601    /*
     602      char buff[LINE];
     603      sprintf(buff, "Error unsetting location: %s", error_message(ret));
     604      owl_function_makemsg(buff);
     605    */
     606  }
     607}
     608
Note: See TracChangeset for help on using the changeset viewer.