- Timestamp:
- Jun 4, 2003, 10:55:13 AM (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:
- 65ad073
- Parents:
- 2824f79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
raa5f725 r6a415e9 91 91 g->aim_screenname=NULL; 92 92 g->aim_loggedin=0; 93 g->aim_lastnop=0;94 93 owl_timer_create_countdown(&(g->aim_noop_timer), 30); 94 owl_timer_create_countdown(&(g->aim_ignorelogin_timer), 0); 95 95 owl_buddylist_init(&(g->buddylist)); 96 96 } … … 647 647 /* AIM stuff */ 648 648 649 int owl_global_is_aimloggedin(owl_global *g) { 649 int owl_global_is_aimloggedin(owl_global *g) 650 { 650 651 if (g->aim_loggedin) return(1); 651 652 return(0); 652 653 } 653 654 654 char *owl_global_get_aim_screenname(owl_global *g) { 655 char *owl_global_get_aim_screenname(owl_global *g) 656 { 655 657 return (g->aim_screenname); 656 658 } 657 659 658 void owl_global_set_aimloggedin(owl_global *g, char *screenname) { 660 void owl_global_set_aimloggedin(owl_global *g, char *screenname) 661 { 659 662 g->aim_loggedin=1; 660 663 if (g->aim_screenname) owl_free(g->aim_screenname); … … 662 665 } 663 666 664 void owl_global_set_aimnologgedin(owl_global *g) { 667 void owl_global_set_aimnologgedin(owl_global *g) 668 { 665 669 g->aim_loggedin=0; 666 670 } 667 671 668 aim_session_t *owl_global_get_aimsess(owl_global *g) { 672 aim_session_t *owl_global_get_aimsess(owl_global *g) 673 { 669 674 return(&(g->aimsess)); 670 675 } 671 676 672 aim_conn_t *owl_global_get_waitingconn(owl_global *g) { 677 aim_conn_t *owl_global_get_waitingconn(owl_global *g) 678 { 673 679 return(&(g->waitingconn)); 674 680 } 675 681 676 int owl_global_is_aimnop_time(owl_global *g) { 677 time_t now; 678 679 now=time(NULL); 680 if (g->aim_lastnop==0) { 681 g->aim_lastnop=now; 682 return(0); 683 } 684 685 if (now-g->aim_lastnop >= 30) { 686 return(1); 687 } 688 return(0); 689 } 690 691 void owl_global_aimnop_sent(owl_global *g) { 692 time_t now; 693 694 now=time(NULL); 695 g->aim_lastnop=now; 682 int owl_global_is_aimnop_time(owl_global *g) 683 { 684 if (owl_timer_is_expired(&(g->aim_noop_timer))) return(1); 685 return(0); 686 } 687 688 void owl_global_aimnop_sent(owl_global *g) 689 { 690 owl_timer_reset(&(g->aim_noop_timer)); 691 } 692 693 owl_timer *owl_global_get_aim_login_timer(owl_global *g) 694 { 695 return(&(g->aim_ignorelogin_timer)); 696 696 } 697 697 698 698 /* message queue */ 699 699 700 void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m) { 700 void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m) 701 { 701 702 owl_list_append_element(&(g->messagequeue), m); 702 703 } … … 706 707 * necessary. 707 708 */ 708 owl_message *owl_global_messageuque_popmsg(owl_global *g) { 709 owl_message *owl_global_messageuque_popmsg(owl_global *g) 710 { 709 711 owl_message *out; 710 712 … … 715 717 } 716 718 717 int owl_global_messagequeue_pending(owl_global *g) { 719 int owl_global_messagequeue_pending(owl_global *g) 720 { 718 721 if (owl_list_get_size(&(g->messagequeue))==0) return(0); 719 722 return(1); 720 723 } 721 724 722 owl_buddylist *owl_global_get_buddylist(owl_global *g) { 725 owl_buddylist *owl_global_get_buddylist(owl_global *g) 726 { 723 727 return(&(g->buddylist)); 724 728 }
Note: See TracChangeset
for help on using the changeset viewer.