| 71 |
SEARCH_USER, |
SEARCH_USER, |
| 72 |
}; |
}; |
| 73 |
|
|
| 74 |
static int section_list_draw_items(int page_id, ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
static int section_list_draw_items(int page_id, const ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
| 75 |
{ |
{ |
| 76 |
char str_time[LINE_BUFFER_LEN]; |
char str_time[LINE_BUFFER_LEN]; |
| 77 |
struct tm tm_sub; |
struct tm tm_sub; |
| 270 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 271 |
{ |
{ |
| 272 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 273 |
|
|
| 274 |
|
// Refresh current action |
| 275 |
|
if (user_online_update(NULL) < 0) |
| 276 |
|
{ |
| 277 |
|
log_error("user_online_update(NULL) error\n"); |
| 278 |
|
} |
| 279 |
} |
} |
| 280 |
|
|
| 281 |
switch (ch) |
switch (ch) |
| 282 |
{ |
{ |
| 283 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 284 |
log_error("KEY_NULL\n"); |
log_debug("KEY_NULL\n"); |
| 285 |
return EXIT_SECTION; |
return EXIT_SECTION; |
| 286 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 287 |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
| 590 |
char stitle[BBS_section_title_max_len + 1]; |
char stitle[BBS_section_title_max_len + 1]; |
| 591 |
char master_list[(BBS_username_max_len + 1) * 3 + 1]; |
char master_list[(BBS_username_max_len + 1) * 3 + 1]; |
| 592 |
char page_info_str[LINE_BUFFER_LEN]; |
char page_info_str[LINE_BUFFER_LEN]; |
| 593 |
ARTICLE *p_articles[BBS_article_limit_per_page]; |
const ARTICLE *p_articles[BBS_article_limit_per_page]; |
| 594 |
int article_count; |
int article_count; |
| 595 |
int page_count; |
int page_count; |
| 596 |
int ontop_start_offset; |
int ontop_start_offset; |
| 1404 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 1405 |
{ |
{ |
| 1406 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 1407 |
|
|
| 1408 |
|
// Refresh current action |
| 1409 |
|
if (user_online_update(NULL) < 0) |
| 1410 |
|
{ |
| 1411 |
|
log_error("user_online_update(NULL) error\n"); |
| 1412 |
|
} |
| 1413 |
} |
} |
| 1414 |
|
|
| 1415 |
switch (ch) |
switch (ch) |
| 1416 |
{ |
{ |
| 1417 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 1418 |
log_error("KEY_NULL\n"); |
log_debug("KEY_NULL\n"); |
| 1419 |
loop = 0; |
loop = 0; |
| 1420 |
break; |
break; |
| 1421 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |