equal
deleted
inserted
replaced
75 char *idsession; |
75 char *idsession; |
76 char *portstring; |
76 char *portstring; |
77 int key; |
77 int key; |
78 unsigned int port; |
78 unsigned int port; |
79 unsigned int ping; |
79 unsigned int ping; |
|
80 int ret = 0; |
80 |
81 |
81 |
82 |
82 credits(); |
83 credits(); |
83 |
84 |
84 /* SET THIS >0 TO ENABLE LOG */ |
85 /* SET THIS >0 TO ENABLE LOG */ |
185 |
186 |
186 ut_WriteLog("Ping interval stablished: %d secs\n", ping); |
187 ut_WriteLog("Ping interval stablished: %d secs\n", ping); |
187 |
188 |
188 ut_WriteLog("Entering into main loop...\n\n"); |
189 ut_WriteLog("Entering into main loop...\n\n"); |
189 ut_WriteLog("Ready to send/receive messages...\n"); |
190 ut_WriteLog("Ready to send/receive messages...\n"); |
190 key = 0; |
191 |
191 while (key != 'x') { |
192 while (ret != 255) { |
192 int x; |
193 int x; |
193 alarm(ping); |
194 alarm(ping); |
194 x = check_io(sock, 0); |
195 x = check_io(sock, 0); |
195 if ((x & 1) == 1) { |
196 if ((x & 1) == 1) { |
196 srv_msg *incoming = readserver(sock); |
197 srv_msg *incoming = readserver(sock); |
212 free(incoming); |
213 free(incoming); |
213 } |
214 } |
214 if ((x & 2) == 2) { |
215 if ((x & 2) == 2) { |
215 keypad(scr_GetRosterWindow(), TRUE); |
216 keypad(scr_GetRosterWindow(), TRUE); |
216 key = scr_Getch(); |
217 key = scr_Getch(); |
|
218 ret = process_key(key); |
|
219 /* |
217 switch (key) { |
220 switch (key) { |
218 case KEY_IC: |
221 case KEY_IC: |
219 bud_AddBuddy(sock); |
222 bud_AddBuddy(sock); |
220 break; |
223 break; |
221 case KEY_DC: |
224 case KEY_DC: |
273 |
276 |
274 case ' ': |
277 case ' ': |
275 scr_ShowBuddyWindow(); |
278 scr_ShowBuddyWindow(); |
276 break; |
279 break; |
277 } |
280 } |
|
281 */ |
278 } |
282 } |
279 } |
283 } |
280 |
284 |
281 bud_TerminateBuddies(); |
285 bud_TerminateBuddies(); |
282 scr_TerminateCurses(); |
286 scr_TerminateCurses(); |