- Timestamp:
- Aug 15, 2009, 7:08:19 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1fdab04
- Parents:
- 25fb825
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 00:44:38)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:19)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
message.c
r1077891a rc08c70a 82 82 * the attribute does not exist 83 83 */ 84 const char *owl_message_get_attribute_value( owl_message *m, const char *attrname)84 const char *owl_message_get_attribute_value(const owl_message *m, const char *attrname) 85 85 { 86 86 int i, j; … … 107 107 * function to indent fmtext. 108 108 */ 109 void owl_message_attributes_tofmtext( owl_message *m, owl_fmtext *fm) {109 void owl_message_attributes_tofmtext(const owl_message *m, owl_fmtext *fm) { 110 110 int i, j; 111 111 owl_pair *p; … … 164 164 } 165 165 166 const char *owl_message_get_class( owl_message *m)166 const char *owl_message_get_class(const owl_message *m) 167 167 { 168 168 const char *class; … … 178 178 } 179 179 180 const char *owl_message_get_instance( owl_message *m)180 const char *owl_message_get_instance(const owl_message *m) 181 181 { 182 182 const char *instance; … … 192 192 } 193 193 194 const char *owl_message_get_sender( owl_message *m)194 const char *owl_message_get_sender(const owl_message *m) 195 195 { 196 196 const char *sender; … … 206 206 } 207 207 208 const char *owl_message_get_zsig( owl_message *m)208 const char *owl_message_get_zsig(const owl_message *m) 209 209 { 210 210 const char *zsig; … … 220 220 } 221 221 222 const char *owl_message_get_recipient( owl_message *m)222 const char *owl_message_get_recipient(const owl_message *m) 223 223 { 224 224 /* this is stupid for outgoing messages, we need to fix it. */ … … 236 236 } 237 237 238 const char *owl_message_get_realm( owl_message *m)238 const char *owl_message_get_realm(const owl_message *m) 239 239 { 240 240 const char *realm; … … 250 250 } 251 251 252 const char *owl_message_get_body( owl_message *m)252 const char *owl_message_get_body(const owl_message *m) 253 253 { 254 254 const char *body; … … 265 265 } 266 266 267 const char *owl_message_get_opcode( owl_message *m)267 const char *owl_message_get_opcode(const owl_message *m) 268 268 { 269 269 const char *opcode; … … 286 286 } 287 287 288 int owl_message_is_loginout( owl_message *m)288 int owl_message_is_loginout(const owl_message *m) 289 289 { 290 290 const char *res; … … 295 295 } 296 296 297 int owl_message_is_login( owl_message *m)297 int owl_message_is_login(const owl_message *m) 298 298 { 299 299 const char *res; … … 306 306 307 307 308 int owl_message_is_logout( owl_message *m)308 int owl_message_is_logout(const owl_message *m) 309 309 { 310 310 const char *res; … … 321 321 } 322 322 323 int owl_message_is_private( owl_message *m)323 int owl_message_is_private(const owl_message *m) 324 324 { 325 325 const char *res; … … 330 330 } 331 331 332 const char *owl_message_get_timestr( owl_message *m)332 const char *owl_message_get_timestr(const owl_message *m) 333 333 { 334 334 if (m->timestr) return(m->timestr); … … 361 361 } 362 362 363 int owl_message_is_type( owl_message *m, const char *type) {363 int owl_message_is_type(const owl_message *m, const char *type) { 364 364 const char * t = owl_message_get_attribute_value(m, "type"); 365 365 if(!t) return 0; … … 367 367 } 368 368 369 int owl_message_is_type_admin( owl_message *m)369 int owl_message_is_type_admin(const owl_message *m) 370 370 { 371 371 return owl_message_is_type(m, "admin"); 372 372 } 373 373 374 int owl_message_is_type_zephyr( owl_message *m)374 int owl_message_is_type_zephyr(const owl_message *m) 375 375 { 376 376 return owl_message_is_type(m, "zephyr"); 377 377 } 378 378 379 int owl_message_is_type_aim( owl_message *m)379 int owl_message_is_type_aim(const owl_message *m) 380 380 { 381 381 return owl_message_is_type(m, "aim"); … … 383 383 384 384 /* XXX TODO: deprecate this */ 385 int owl_message_is_type_jabber( owl_message *m)385 int owl_message_is_type_jabber(const owl_message *m) 386 386 { 387 387 return owl_message_is_type(m, "jabber"); 388 388 } 389 389 390 int owl_message_is_type_loopback( owl_message *m)390 int owl_message_is_type_loopback(const owl_message *m) 391 391 { 392 392 return owl_message_is_type(m, "loopback"); 393 393 } 394 394 395 int owl_message_is_pseudo( owl_message *m)395 int owl_message_is_pseudo(const owl_message *m) 396 396 { 397 397 if (owl_message_get_attribute_value(m, "pseudo")) return(1); … … 425 425 } 426 426 427 int owl_message_is_direction_in( owl_message *m)427 int owl_message_is_direction_in(const owl_message *m) 428 428 { 429 429 if (m->direction==OWL_MESSAGE_DIRECTION_IN) return(1); … … 431 431 } 432 432 433 int owl_message_is_direction_out( owl_message *m)433 int owl_message_is_direction_out(const owl_message *m) 434 434 { 435 435 if (m->direction==OWL_MESSAGE_DIRECTION_OUT) return(1); … … 437 437 } 438 438 439 int owl_message_is_direction_none( owl_message *m)439 int owl_message_is_direction_none(const owl_message *m) 440 440 { 441 441 if (m->direction==OWL_MESSAGE_DIRECTION_NONE) return(1); … … 462 462 } 463 463 464 const char *owl_message_get_zwriteline( owl_message *m)464 const char *owl_message_get_zwriteline(const owl_message *m) 465 465 { 466 466 const char *z = owl_message_get_attribute_value(m, "zwriteline"); … … 474 474 } 475 475 476 int owl_message_is_delete( owl_message *m)476 int owl_message_is_delete(const owl_message *m) 477 477 { 478 478 if (m == NULL) return(0); … … 482 482 483 483 #ifdef HAVE_LIBZEPHYR 484 const ZNotice_t *owl_message_get_notice( owl_message *m)484 const ZNotice_t *owl_message_get_notice(const owl_message *m) 485 485 { 486 486 return(&(m->notice)); 487 487 } 488 488 #else 489 void *owl_message_get_notice( owl_message *m)489 void *owl_message_get_notice(const owl_message *m) 490 490 { 491 491 return(NULL); … … 498 498 } 499 499 500 const char *owl_message_get_hostname( owl_message *m)500 const char *owl_message_get_hostname(const owl_message *m) 501 501 { 502 502 return(m->hostname); … … 524 524 } 525 525 526 int owl_message_is_personal( owl_message *m)526 int owl_message_is_personal(const owl_message *m) 527 527 { 528 528 owl_filter * f = owl_global_get_filter(&g, "personal"); … … 534 534 } 535 535 536 int owl_message_is_question( owl_message *m)536 int owl_message_is_question(const owl_message *m) 537 537 { 538 538 if(!owl_message_is_type_admin(m)) return 0; … … 541 541 } 542 542 543 int owl_message_is_answered( owl_message *m) {543 int owl_message_is_answered(const owl_message *m) { 544 544 const char *q; 545 545 if(!owl_message_is_question(m)) return 0; … … 553 553 } 554 554 555 int owl_message_is_mail( owl_message *m)555 int owl_message_is_mail(const owl_message *m) 556 556 { 557 557 if (owl_message_is_type_zephyr(m)) { … … 566 566 567 567 /* caller must free return value. */ 568 char *owl_message_get_cc( owl_message *m)568 char *owl_message_get_cc(const owl_message *m) 569 569 { 570 570 const char *cur; … … 583 583 584 584 /* caller must free return value */ 585 char *owl_message_get_cc_without_recipient( owl_message *m)585 char *owl_message_get_cc_without_recipient(const owl_message *m) 586 586 { 587 587 char *cc, *out, *end, *shortuser, *recip; … … 620 620 } 621 621 622 int owl_message_get_id( owl_message *m)622 int owl_message_get_id(const owl_message *m) 623 623 { 624 624 return(m->id); 625 625 } 626 626 627 const char *owl_message_get_type( owl_message *m) {627 const char *owl_message_get_type(const owl_message *m) { 628 628 const char * type = owl_message_get_attribute_value(m, "type"); 629 629 if(!type) { … … 633 633 } 634 634 635 const char *owl_message_get_direction( owl_message *m) {635 const char *owl_message_get_direction(const owl_message *m) { 636 636 switch (m->direction) { 637 637 case OWL_MESSAGE_DIRECTION_IN: … … 657 657 658 658 659 const char *owl_message_get_login( owl_message *m) {659 const char *owl_message_get_login(const owl_message *m) { 660 660 if (owl_message_is_login(m)) { 661 661 return "login"; … … 668 668 669 669 670 const char *owl_message_get_header( owl_message *m) {670 const char *owl_message_get_header(const owl_message *m) { 671 671 return owl_message_get_attribute_value(m, "adminheader"); 672 672 }
Note: See TracChangeset
for help on using the changeset viewer.