Changeset 7933748


Ignore:
Timestamp:
Feb 21, 2003, 10:50:15 AM (18 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:
ed2412d
Parents:
2c8d62e
Message:
Added a 'loadloginsubs' command to load login subscriptions from a
  file
Added a 'loadsubs' command to eventually phase out the 'load-subs'
  command
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r2c8d62e r7933748  
    2323        Renamed old instances of zsig_exec in the code to zsigproc
    2424        Don't print the stderr from zsigproc
     25        Added a 'loadloginsubs' command to load login subscriptions from a
     26          file
     27        Added a 'loadsubs' command to eventually phase out the 'load-subs'
     28          command
    2529
    26301.2.8
  • commands.c

    r5c7b1b1 r7933748  
    365365              "load subscriptions from a file",
    366366              "load-subs <file>\n", ""),
     367
     368  OWLCMD_ARGS("loadsubs", owl_command_loadsubs, OWL_CTX_ANY,
     369              "load subscriptions from a file",
     370              "loadsubs <file>\n", ""),
     371
     372  OWLCMD_ARGS("loadloginsubs", owl_command_loadloginsubs, OWL_CTX_ANY,
     373              "load login subscriptions from a file",
     374              "loadloginsubs <file>\n",
     375              "The file should contain a list of usernames, one per line."),
    367376
    368377  OWLCMD_VOID("about", owl_command_about, OWL_CTX_INTERACTIVE,
     
    933942  } else {
    934943    owl_function_makemsg("Wrong number of arguments for load-subs.");
    935     return NULL;
    936   }
    937   return NULL;
     944    return(NULL);
     945  }
     946  return(NULL);
     947}
     948
     949
     950char *owl_command_loadloginsubs(int argc, char **argv, char *buff) {
     951  if (argc == 2) {
     952    owl_function_loadloginsubs(argv[1]);
     953  } else if (argc == 1) {
     954    owl_function_loadloginsubs(NULL);
     955  } else {
     956    owl_function_makemsg("Wrong number of arguments for load-subs.");
     957    return(NULL);
     958  }
     959  return(NULL);
    938960}
    939961
  • functions.c

    rced25d1 r7933748  
    522522  } else {
    523523    owl_function_makemsg("Error subscribing to messages from file.");
     524  }
     525}
     526
     527void owl_function_loadloginsubs(char *file) {
     528  int ret;
     529  ret=owl_zephyr_loadloginsubs(file);
     530  if (ret==0) {
     531    owl_function_makemsg("Subscribed to login messages from file.");
     532  } else if (ret==-1) {
     533    owl_function_makemsg("Could not open file for login subscriptions.");
     534  } else {
     535    owl_function_makemsg("Error subscribing to login messages from file.");
    524536  }
    525537}
  • owl.c

    rced25d1 r7933748  
    205205  /* load login subs */
    206206  if (owl_global_is_loginsubs(&g)) {
    207     loadloginsubs(NULL);
     207    owl_function_loadloginsubs(NULL);
    208208  }
    209209
  • zephyr.c

    r060b3b4 r7933748  
    8181}
    8282
    83 int loadloginsubs(char *filename) {
     83int owl_zephyr_loadloginsubs(char *filename) {
    8484  FILE *file;
    8585  ZSubscription_t subs[3001];
     
    122122
    123123  /* sub with defaults */
    124   if (ZSubscribeTo(subs,count,0) != ZERR_NONE) {
     124  if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) {
    125125    fprintf(stderr, "Error subbing\n");
    126126    ret=-2;
Note: See TracChangeset for help on using the changeset viewer.