Changeset 4357be8


Ignore:
Timestamp:
Dec 26, 2003, 2:01:32 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:
32eed98
Parents:
bf73bdd
Message:
Don't print an error about loading subs if there is no .zephyr.subs
Do the initial zephyr_buddy_check when pseduologin set to true.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rbf73bdd r4357be8  
    11$Id$
    22
     32.1.3-pre-1
     4        Don't print an error about loading subs if there is no
     5          .zephyr.subs
     6        Do the initial zephyr_buddy_check when pseduologin set to true.
     7       
    382.1.2
    49        removed unused filter_depth variable
  • functions.c

    r3895e23 r4357be8  
    810810void owl_function_loadsubs(char *file)
    811811{
    812   int ret;
     812  int ret, ret2;
    813813
    814814  ret=owl_zephyr_loadsubs(file);
     815
     816  /* for backwards compatibility for now */
     817  ret2=owl_zephyr_loaddefaultsubs();
    815818
    816819  if (!owl_context_is_interactive(owl_global_get_context(&g))) return;
  • owl.c

    r81634b6 r4357be8  
    326326  /* load zephyr subs */
    327327  if (initialsubs) {
     328    int ret2;
    328329    owl_function_debugmsg("startup: loading initial zephyr subs");
    329     /* load normal subscriptions */
    330     ret=owl_zephyr_loadsubs(NULL);
    331     if (ret==-1) {
    332       owl_function_adminmsg("", "Error loading zephyr subscriptions, file inaccessable");
    333     } else if (ret!=0) {
     330
     331    /* load default subscriptions */
     332    ret=owl_zephyr_loaddefaultsubs();
     333   
     334    /* load subscriptions from subs file */
     335    ret2=owl_zephyr_loadsubs(NULL);
     336
     337    if (ret || ret2) {
    334338      owl_function_adminmsg("", "Error loading zephyr subscriptions");
    335     }
    336    
    337     if (ret!=-1) {
     339    } else if (ret2!=-1) {
    338340      owl_global_add_userclue(&g, OWL_USERCLUE_CLASSES);
    339341    }
     
    348350  /* First buddy check to sync the list without notifications */
    349351  owl_function_debugmsg("startup: doing initial zephyr buddy check");
    350   owl_function_zephyr_buddy_check(0);
     352  /* owl_function_zephyr_buddy_check(0); */
    351353
    352354  /* set the startup and default style, based on userclue and presence of a
  • owl.h

    rbf73bdd r4357be8  
    2020static const char owl_h_fileIdent[] = "$Id$";
    2121
    22 #define OWL_VERSION         2.1.2
    23 #define OWL_VERSION_STRING "2.1.2"
     22#define OWL_VERSION         2.1.3-pre-1
     23#define OWL_VERSION_STRING "2.1.3-pre-1"
    2424
    2525/* Feature that is being tested to redirect stderr through a pipe.
  • variable.c

    r3038d13 r4357be8  
    136136               "" ),
    137137
    138   OWLVAR_BOOL( "pseudologins" /* %OwlVarStub */, 0,
    139                "Enable zephyr pseudo logins",
    140                "When this is enabled, Owl will periodically check the zephyr\n"
    141                "location of users in your .anyone file.  If a user is present\n"
    142                "but sent no login message, or a user is not present that sent no\n"
    143                "logout message a pseudo login or logout message wil be created\n"),
     138  OWLVAR_BOOL_FULL( "pseudologins" /* %OwlVarStub */, 0,
     139                    "Enable zephyr pseudo logins",
     140                    "When this is enabled, Owl will periodically check the zephyr\n"
     141                    "location of users in your .anyone file.  If a user is present\n"
     142                    "but sent no login message, or a user is not present that sent no\n"
     143                    "logout message a pseudo login or logout message wil be created\n",
     144                    NULL, owl_variable_pseudologins_set, NULL),
    144145
    145146  OWLVAR_BOOL( "ignorelogins" /* %OwlVarStub */, 0,
     
    352353/* commonly useful */
    353354
    354 int owl_variable_int_validate_gt0(owl_variable *v, void *newval) {
     355int owl_variable_int_validate_gt0(owl_variable *v, void *newval)
     356{
    355357  if (newval == NULL) return(0);
    356358  else if (*(int*)newval < 1) return(0);
     
    358360}
    359361
    360 int owl_variable_int_validate_positive(owl_variable *v, void *newval) {
     362int owl_variable_int_validate_positive(owl_variable *v, void *newval)
     363{
    361364  if (newval == NULL) return(0);
    362365  else if (*(int*)newval < 0) return(0);
     
    365368
    366369/* typewinsize */
    367 
    368 int owl_variable_typewinsize_set(owl_variable *v, void *newval) {
     370int owl_variable_typewinsize_set(owl_variable *v, void *newval)
     371{
    369372  int rv;
    370373  rv = owl_variable_int_set_default(v, newval);
     
    374377
    375378/* debug (cache value in g->debug) */
    376 int owl_variable_debug_set(owl_variable *v, void *newval) {
     379int owl_variable_debug_set(owl_variable *v, void *newval)
     380{
    377381  if (newval && (*(int*)newval == 1 || *(int*)newval == 0)) {
    378382    g.debug = *(int*)newval;
     
    382386
    383387/* When 'aaway' is changed, need to notify the AIM server */
    384 int owl_variable_aaway_set(owl_variable *v, void *newval) {
     388int owl_variable_aaway_set(owl_variable *v, void *newval)
     389{
    385390  if (newval) {
    386391    if (*(int*)newval == 1) {
     
    393398}
    394399
     400int owl_variable_pseudologins_set(owl_variable *v, void *newval)
     401{
     402  if (newval) {
     403    if (*(int*)newval == 1) {
     404      owl_function_zephyr_buddy_check(0);
     405    }
     406  }
     407  return owl_variable_bool_set_default(v, newval);
     408}
     409
    395410/* note that changing the value of this will clobber
    396411 * any user setting of this */
    397 int owl_variable_disable_ctrl_d_set(owl_variable *v, void *newval) {
     412int owl_variable_disable_ctrl_d_set(owl_variable *v, void *newval)
     413{
    398414
    399415  if (in_regtest) return owl_variable_int_set_default(v, newval);
     
    411427}
    412428
    413 int owl_variable_tty_set(owl_variable *v, void *newval) {
     429int owl_variable_tty_set(owl_variable *v, void *newval)
     430{
    414431  owl_zephyr_set_locationinfo(owl_global_get_hostname(&g), newval);
    415432  return(owl_variable_string_set_default(v, newval));
  • zephyr.c

    rbf73bdd r4357be8  
    33#include <sys/types.h>
    44#include <sys/wait.h>
     5#include <sys/stat.h>
    56#include <string.h>
    67#include "owl.h"
     
    7879  ZSubscription_t subs[3001];
    7980  int count, ret, i;
    80 
    81   ret=0;
    82  
     81  struct stat statbuff;
     82
    8383  if (filename==NULL) {
    8484    sprintf(subsfile, "%s/%s", owl_global_get_homedir(&g), ".zephyr.subs");
     
    8686    strcpy(subsfile, filename);
    8787  }
     88
     89  ret=stat(subsfile, &statbuff);
     90  if (ret) return(0);
     91
     92  ret=0;
    8893
    8994  ZResetAuthentication();
     
    124129  }
    125130
    126   /* sub with defaults */
    127   if (ZSubscribeTo(subs,count,0) != ZERR_NONE) {
     131  /* sub without defaults */
     132  if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) {
    128133    owl_function_error("Error subscribing to zephyr notifications.");
    129134    ret=-2;
     
    143148}
    144149
     150int owl_zephyr_loaddefaultsubs()
     151{
     152  ZSubscription_t subs[10];
     153   
     154  if (ZSubscribeTo(subs,0,0) != ZERR_NONE) {
     155    owl_function_error("Error subscribing to default zephyr notifications.");
     156    return(-1);
     157  }
     158  return(0);
     159}
     160
    145161int owl_zephyr_loadloginsubs(char *filename)
    146162{
     
    150166  char subsfile[1024], buffer[1024];
    151167  int count, ret, i;
    152 
    153   ret=0;
     168  struct stat statbuff;
    154169
    155170  if (filename==NULL) {
     
    158173    strcpy(subsfile, filename);
    159174  }
     175 
     176  ret=stat(subsfile, &statbuff);
     177  if (ret) return(0);
     178
     179  ret=0;
    160180
    161181  ZResetAuthentication();
Note: See TracChangeset for help on using the changeset viewer.