Changeset 31e48a3
- Timestamp:
- Jun 1, 2003, 2:42:58 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- df0d93a
- Parents:
- 0ff8fb57
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rd09e5a1 r31e48a3 73 73 Added basic AIM support, including the "aimlogin", "aimwrite" and 74 74 "aimlogout" commands 75 New built-in filters 'aim' and 'zephyr'. 76 Do ZResetAuthentication() before zlog_in and zlog_out as well. 75 77 76 78 1.2.8 -
commands.c
r0ff8fb57 r31e48a3 1236 1236 owl_global_set_tty(&g, argv[2]); 1237 1237 } 1238 owl_ function_zlog_in();1238 owl_zephyr_zlog_in(); 1239 1239 } else if (!strcmp(argv[1], "out")) { 1240 1240 if (argc!=2) { … … 1242 1242 return(NULL); 1243 1243 } 1244 owl_ function_zlog_out();1244 owl_zephyr_zlog_out(); 1245 1245 } else { 1246 1246 owl_function_makemsg("Invalid subcommand for zlog"); … … 1250 1250 1251 1251 1252 void owl_command_zlog_out( ) {1253 owl_ function_zlog_out();1252 void owl_command_zlog_out(void) { 1253 owl_zephyr_zlog_out(); 1254 1254 } 1255 1255 -
functions.c
r0ff8fb57 r31e48a3 693 693 /* zlog out if we need to */ 694 694 if (owl_global_is_shutdownlogout(&g)) { 695 owl_ function_zlog_out();695 owl_zephyr_zlog_out(); 696 696 } 697 697 … … 711 711 owl_function_debugmsg("Quitting Owl"); 712 712 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 }761 713 } 762 714 -
owl.c
rd09e5a1 r31e48a3 167 167 168 168 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)); 169 177 owl_filter_init_fromstring(f, "none", "false"); 170 178 owl_list_append_element(owl_global_get_filterlist(&g), f); … … 212 220 /* zlog in if we need to */ 213 221 if (owl_global_is_startuplogin(&g)) { 214 owl_ function_zlog_in();222 owl_zephyr_zlog_in(); 215 223 } 216 224 -
owl_prototypes.h
r0ff8fb57 r31e48a3 80 80 extern char *owl_command_term(int argc, char **argv, char *buff); 81 81 extern char *owl_command_zlog(int argc, char **argv, char *buff); 82 extern void owl_command_zlog_out( );82 extern void owl_command_zlog_out(void); 83 83 extern char *owl_command_subscribe(int argc, char **argv, char *buff); 84 84 extern char *owl_command_unsubscribe(int argc, char **argv, char *buff); … … 309 309 extern void owl_function_zaway_off(); 310 310 extern void owl_function_quit(); 311 extern void owl_function_zlog_in();312 extern void owl_function_zlog_out();313 311 extern void owl_function_makemsg(char *fmt, ...); 314 312 extern void owl_function_errormsg(char *fmt, ...); … … 931 929 extern void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip); 932 930 extern char *owl_zephyr_makesubline(char *class, char *inst, char *recip); 931 extern void owl_zephyr_zlog_in(void); 932 extern void owl_zephyr_zlog_out(void); 933 933 934 934 /* -------------------------------- zwrite.c -------------------------------- */ -
zephyr.c
r8262340 r31e48a3 12 12 Code_t ZResetAuthentication(); 13 13 14 int owl_zephyr_loadsubs(char *filename) { 14 int owl_zephyr_loadsubs(char *filename) 15 { 15 16 /* return 0 on success 16 17 * -1 on file error … … 84 85 } 85 86 86 int owl_zephyr_loadloginsubs(char *filename) { 87 int owl_zephyr_loadloginsubs(char *filename) 88 { 87 89 FILE *file; 88 90 ZSubscription_t subs[3001]; … … 139 141 } 140 142 141 void unsuball() { 143 void unsuball() 144 { 142 145 int ret; 143 146 … … 149 152 } 150 153 151 int owl_zephyr_sub(char *class, char *inst, char *recip) { 154 int owl_zephyr_sub(char *class, char *inst, char *recip) 155 { 152 156 ZSubscription_t subs[5]; 153 157 int ret; … … 166 170 167 171 168 int owl_zephyr_unsub(char *class, char *inst, char *recip) { 172 int owl_zephyr_unsub(char *class, char *inst, char *recip) 173 { 169 174 ZSubscription_t subs[5]; 170 175 int ret; … … 183 188 184 189 185 char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k) { 190 char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k) 191 { 186 192 /* return a pointer to the Jth field, place the length in k. If the 187 193 field doesn't exist return an emtpy string */ … … 212 218 213 219 214 int owl_zephyr_get_num_fields(ZNotice_t *n) { 220 int owl_zephyr_get_num_fields(ZNotice_t *n) 221 { 215 222 int i, fields; 216 223 … … 224 231 225 232 226 char *owl_zephyr_get_message(ZNotice_t *n, int *k) { 233 char *owl_zephyr_get_message(ZNotice_t *n, int *k) 234 { 227 235 /* return a pointer to the message, place the message length in k */ 228 236 if (!strcasecmp(n->z_opcode, "ping")) { … … 235 243 236 244 237 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k) { 245 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k) 246 { 238 247 /* return a pointer to the zsig if there is one */ 239 248 … … 247 256 248 257 249 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message) { 258 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message) 259 { 250 260 int ret; 251 261 ZNotice_t notice; … … 287 297 } 288 298 289 Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait) { 299 Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait) 300 { 290 301 return(ZSendPacket(buf, len, 0)); 291 302 } 292 303 293 void send_ping(char *to) { 304 void send_ping(char *to) 305 { 294 306 send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, ""); 295 307 } 296 308 297 void owl_zephyr_handle_ack(ZNotice_t *retnotice) { 309 void owl_zephyr_handle_ack(ZNotice_t *retnotice) 310 { 298 311 char *tmp; 299 312 … … 331 344 } 332 345 333 int owl_zephyr_notice_is_ack(ZNotice_t *n) { 346 int owl_zephyr_notice_is_ack(ZNotice_t *n) 347 { 334 348 if (n->z_kind == SERVNAK || n->z_kind == SERVACK || n->z_kind == HMACK) { 335 349 if (!strcasecmp(n->z_class, LOGIN_CLASS)) return(0); … … 339 353 } 340 354 341 void owl_zephyr_zaway(owl_message *m) { 355 void owl_zephyr_zaway(owl_message *m) 356 { 342 357 char *tmpbuff, *myuser, *to; 343 358 … … 380 395 381 396 382 void owl_zephyr_hackaway_cr(ZNotice_t *n) { 397 void owl_zephyr_hackaway_cr(ZNotice_t *n) 398 { 383 399 /* replace \r's with ' '. Gross-ish */ 384 400 int i; … … 391 407 } 392 408 393 void owl_zephyr_zlocate(char *user, char *out, int auth) { 409 void owl_zephyr_zlocate(char *user, char *out, int auth) 410 { 394 411 int ret, numlocs; 395 412 int one = 1; … … 419 436 } 420 437 421 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip) { 438 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip) 439 { 422 440 char *line, subsfile[LINE], buff[LINE]; 423 441 FILE *file; … … 461 479 } 462 480 463 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip) { 481 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip) 482 { 464 483 char *line, subsfile[LINE], buff[LINE], *text; 465 484 char backupfilename[LINE]; … … 527 546 } 528 547 529 char *owl_zephyr_makesubline(char *class, char *inst, char *recip) { 548 char *owl_zephyr_makesubline(char *class, char *inst, char *recip) 549 { 530 550 /* caller must free the return */ 531 551 char *out; … … 535 555 return(out); 536 556 } 557 558 559 void 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 594 void 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.