| 16 |
|
|
| 17 |
#include "common.h" |
#include "common.h" |
| 18 |
#include "io.h" |
#include "io.h" |
|
#include "lml.h" |
|
| 19 |
#include "log.h" |
#include "log.h" |
| 20 |
#include "login.h" |
#include "login.h" |
| 21 |
#include "screen.h" |
#include "screen.h" |
| 22 |
#include "str_process.h" |
#include "str_process.h" |
| 23 |
#include "user_list.h" |
#include "user_list.h" |
| 24 |
#include "user_priv.h" |
#include "user_priv.h" |
| 25 |
|
#include "user_info_display.h" |
| 26 |
#include "user_list_display.h" |
#include "user_list_display.h" |
| 27 |
#include <string.h> |
#include <string.h> |
| 28 |
#include <time.h> |
#include <time.h> |
| 37 |
SHOW_HELP, |
SHOW_HELP, |
| 38 |
}; |
}; |
| 39 |
|
|
|
static int display_user_intro_key_handler(int *p_key, DISPLAY_CTX *p_ctx) |
|
|
{ |
|
|
return 0; |
|
|
} |
|
|
|
|
| 40 |
static int user_list_draw_screen(int online_user) |
static int user_list_draw_screen(int online_user) |
| 41 |
{ |
{ |
| 42 |
clearscr(); |
clearscr(); |
| 446 |
} |
} |
| 447 |
break; |
break; |
| 448 |
case VIEW_USER: |
case VIEW_USER: |
| 449 |
clearscr(); |
user_info_display(online_user ? &(online_users[selected_index].user_info) : &(users[selected_index])); |
|
if (online_user) |
|
|
{ |
|
|
USER_ONLINE_INFO users[5]; |
|
|
int user_cnt = 5; |
|
|
ret = query_user_online_info_by_uid(online_users[selected_index].user_info.uid, users, &user_cnt, 0); |
|
|
if (ret <= 0) |
|
|
{ |
|
|
log_error("query_user_online_info_by_uid(uid=%d, cnt=%d) error: %d\n", |
|
|
online_users[selected_index].user_info.uid, user_cnt, ret); |
|
|
} |
|
|
else |
|
|
{ |
|
|
moveto(1, 1); |
|
|
prints("已选中用户 [%s] 会话 %d", online_users[selected_index].user_info.username, online_users[selected_index].id); |
|
|
|
|
|
for (int i = 0; i < user_cnt; i++) |
|
|
{ |
|
|
moveto(2 + i, 1); |
|
|
prints("会话%d", users[i].id); |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
char intro_f[BBS_user_intro_max_len]; |
|
|
char profile_f[BUFSIZ]; |
|
|
long line_offsets[BBS_user_intro_max_line + 1]; |
|
|
long lines; |
|
|
|
|
|
lml_render(users[selected_index].intro, intro_f, sizeof(intro_f), 0); |
|
|
|
|
|
snprintf(profile_f, sizeof(profile_f), |
|
|
"已选中用户 [%s]\n发帖数:%d\n\n%s\n", |
|
|
users[selected_index].username, |
|
|
get_user_article_cnt(users[selected_index].uid), |
|
|
intro_f); |
|
|
|
|
|
lines = split_data_lines(profile_f, SCREEN_COLS, line_offsets, BBS_user_intro_max_line + 4, 1, NULL); |
|
|
display_data(profile_f, lines, line_offsets, 2, display_user_intro_key_handler, DATA_READ_HELP); |
|
|
} |
|
|
press_any_key(); |
|
| 450 |
user_list_draw_screen(online_user); |
user_list_draw_screen(online_user); |
| 451 |
break; |
break; |
| 452 |
case SHOW_HELP: |
case SHOW_HELP: |