comparison mcabber/src/main.c @ 81:0bd578421ce9

[/trunk] Changeset 95 by mikael * Switch from buddies.* to roster.* Seems to work fine...
author mikael
date Sat, 16 Apr 2005 22:28:55 +0000
parents 32f54ad6d729
children f600615c490d
comparison
equal deleted inserted replaced
80:7fb661f19a77 81:0bd578421ce9
4 #include <string.h> 4 #include <string.h>
5 #include <signal.h> 5 #include <signal.h>
6 #include <termios.h> 6 #include <termios.h>
7 #include <getopt.h> 7 #include <getopt.h>
8 8
9 #include "utils.h" 9 #include "jabglue.h"
10 #include "screen.h" 10 #include "screen.h"
11 #include "buddies.h"
12 #include "parsecfg.h" 11 #include "parsecfg.h"
13 #include "lang.h" 12 #include "lang.h"
13 #include "utils.h"
14 #include "harddefines.h" 14 #include "harddefines.h"
15 #include "jabglue.h"
16 15
17 16
18 void sig_handler(int signum) 17 void sig_handler(int signum)
19 { 18 {
20 switch (signum) { 19 switch (signum) {
21 case SIGALRM: 20 case SIGALRM:
22 jb_keepalive(); 21 jb_keepalive();
23 break; 22 break;
24 23
25 case SIGTERM: 24 case SIGTERM:
26 bud_TerminateBuddies(); 25 // bud_TerminateBuddies();
27 scr_TerminateCurses(); 26 scr_TerminateCurses();
28 jb_disconnect(); 27 jb_disconnect();
29 printf("Killed by SIGTERM\nBye!\n"); 28 printf("Killed by SIGTERM\nBye!\n");
30 exit(EXIT_SUCCESS); 29 exit(EXIT_SUCCESS);
31 break; 30 break;
184 ut_WriteLog("Ping interval stablished: %d secs\n", ping); 183 ut_WriteLog("Ping interval stablished: %d secs\n", ping);
185 184
186 ut_WriteLog("Entering into main loop...\n\n"); 185 ut_WriteLog("Entering into main loop...\n\n");
187 ut_WriteLog("Ready to send/receive messages...\n"); 186 ut_WriteLog("Ready to send/receive messages...\n");
188 187
188 keypad(scr_GetInputWindow(), TRUE);
189 while (ret != 255) { 189 while (ret != 255) {
190 alarm(ping); 190 alarm(ping);
191 keypad(scr_GetInputWindow(), TRUE);
192 key = scr_Getch(); 191 key = scr_Getch();
193 if (key != ERR) 192 if (key != ERR)
194 ret = process_key(key); 193 ret = process_key(key);
195 jb_main(); 194 jb_main();
196 if (update_roster) 195 if (update_roster)
197 bud_DrawRoster(scr_GetRosterWindow()); 196 scr_DrawRoster();
198 } 197 }
199 198
200 jb_disconnect(); 199 jb_disconnect();
201 bud_TerminateBuddies(); 200 //bud_TerminateBuddies();
202 scr_TerminateCurses(); 201 scr_TerminateCurses();
203 202
204 printf("\n\nHave a nice day!\nBye!\n"); 203 printf("\n\nHave a nice day!\nBye!\n");
205 204
206 return 0; 205 return 0;