/[LeafOK_CVS]/lbbs/src/section_list_display.c
ViewVC logotype

Diff of /lbbs/src/section_list_display.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.60 by sysadm, Sun Nov 2 08:35:23 2025 UTC Revision 1.80 by sysadm, Wed Dec 3 14:04:02 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                          section_list_display.c  -  description  /*
3                                                           -------------------   * section_list_display
4          Copyright            : (C) 2004-2025 by Leaflet   *   - user interactive feature of section articles list
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7     */
8  /***************************************************************************  
9   *                                                                         *  #ifdef HAVE_CONFIG_H
10   *   This program is free software; you can redistribute it and/or modify  *  #include "config.h"
11   *   it under the terms of the GNU General Public License as published by  *  #endif
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
12    
13  #include "article_cache.h"  #include "article_cache.h"
14  #include "article_favor.h"  #include "article_favor.h"
# Line 31  Line 27 
27  #include "screen.h"  #include "screen.h"
28  #include "str_process.h"  #include "str_process.h"
29  #include "user_info_display.h"  #include "user_info_display.h"
30    #include "user_list_display.h"
31  #include "user_priv.h"  #include "user_priv.h"
32    #include <ctype.h>
33  #include <errno.h>  #include <errno.h>
34  #include <string.h>  #include <string.h>
35  #include <time.h>  #include <time.h>
36  #include <sys/param.h>  #include <sys/param.h>
37    
38    enum _section_list_display_constant_t
39    {
40            TITLE_SEARCH_MAX_LEN = 60,
41    };
42    
43  static int32_t section_aid_locations[BBS_max_section] = {0};  static int32_t section_aid_locations[BBS_max_section] = {0};
44  static int section_topic_view_mode = 0;  static int section_topic_view_mode = 0;
45  static int section_topic_view_tid = -1;  static int section_topic_view_tid = -1;
# Line 57  enum select_cmd_t Line 60  enum select_cmd_t
60          UNSET_FAVOR_ARTICLE,          UNSET_FAVOR_ARTICLE,
61          FIRST_TOPIC_ARTICLE,          FIRST_TOPIC_ARTICLE,
62          LAST_TOPIC_ARTICLE,          LAST_TOPIC_ARTICLE,
63            LAST_SECTION_ARTICLE,
64          SCAN_NEW_ARTICLE,          SCAN_NEW_ARTICLE,
65            SCAN_ARTICLE_BACKWARD_BY_USER,
66            SCAN_ARTICLE_FORWARD_BY_USER,
67            SCAN_ARTICLE_BACKWARD_BY_TITLE,
68            SCAN_ARTICLE_FORWARD_BY_TITLE,
69          VIEW_EX_DIR,          VIEW_EX_DIR,
70          SHOW_TOP10,          SHOW_TOP10,
71            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;
# Line 216  static int section_list_draw_screen(cons Line 225  static int section_list_draw_screen(cons
225    
226          if (master_list[0] != '\0')          if (master_list[0] != '\0')
227          {          {
228                  snprintf(str_section_master, sizeof(str_section_master), "版主:%s", master_list);                  snprintf(str_section_master, sizeof(str_section_master), "版主: %s", master_list);
229          }          }
230          snprintf(str_section_name, sizeof(str_section_name), "讨论区 [%s]", sname);          snprintf(str_section_name, sizeof(str_section_name), "讨论区 [%s]", sname);
231    
# Line 261  static enum select_cmd_t section_list_se Line 270  static enum select_cmd_t section_list_se
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)
# Line 269  static enum select_cmd_t section_list_se Line 284  static enum select_cmd_t section_list_se
284                          log_error("KEY_NULL\n");                          log_error("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 >= MAX_DELAY_TIME)                          if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time)
288                          {                          {
289                                  log_error("User input timeout\n");                                  log_error("User input timeout\n");
290                                  return EXIT_SECTION;                                  return EXIT_SECTION;
# Line 359  static enum select_cmd_t section_list_se Line 374  static enum select_cmd_t section_list_se
374                          break;                          break;
375                  case '$':                  case '$':
376                  case KEY_END:                  case KEY_END:
377                            if (*p_page_id + 1 == total_page && *p_selected_index + 1 == item_count) // Press END at end of list
378                            {
379                                    return LAST_SECTION_ARTICLE;
380                            }
381                          if (total_page > 0)                          if (total_page > 0)
382                          {                          {
383                                  *p_page_id = total_page - 1;                                  *p_page_id = total_page - 1;
# Line 407  static enum select_cmd_t section_list_se Line 426  static enum select_cmd_t section_list_se
426                                  return SCAN_NEW_ARTICLE;                                  return SCAN_NEW_ARTICLE;
427                          }                          }
428                          break;                          break;
429                    case 'A':
430                            if (item_count > 0)
431                            {
432                                    return SCAN_ARTICLE_BACKWARD_BY_USER;
433                            }
434                            break;
435                    case 'a':
436                            if (item_count > 0)
437                            {
438                                    return SCAN_ARTICLE_FORWARD_BY_USER;
439                            }
440                            break;
441                    case '?':
442                            if (item_count > 0)
443                            {
444                                    return SCAN_ARTICLE_BACKWARD_BY_TITLE;
445                            }
446                            break;
447                    case '/':
448                            if (item_count > 0)
449                            {
450                                    return SCAN_ARTICLE_FORWARD_BY_TITLE;
451                            }
452                            break;
453                    case 'u':
454                            return SEARCH_USER;
455                  case 'h':                  case 'h':
456                          return SHOW_HELP;                          return SHOW_HELP;
457                  case 'x':                  case 'x':
# Line 545  int section_list_display(const char *sna Line 590  int section_list_display(const char *sna
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;
# Line 559  int section_list_display(const char *sna Line 604  int section_list_display(const char *sna
604          int page_id_cur;          int page_id_cur;
605          const ARTICLE *p_article_locate;          const ARTICLE *p_article_locate;
606          USER_INFO user_info;          USER_INFO user_info;
607            char user_intro[BBS_user_intro_max_len + 1];
608            char username[BBS_username_max_len + 1];
609            char username_list[1][BBS_username_max_len + 1];
610            int32_t uid;
611            int i;
612            int ok;
613            char title[BBS_article_title_max_len + 1] = "\0";
614    
615          p_section = section_list_find_by_name(sname);          p_section = section_list_find_by_name(sname);
616          if (p_section == NULL)          if (p_section == NULL)
# Line 662  int section_list_display(const char *sna Line 714  int section_list_display(const char *sna
714    
715                  ret = section_list_select(page_count, article_count, &page_id, &selected_index);                  ret = section_list_select(page_count, article_count, &page_id, &selected_index);
716    
                 // Update current aid location  
                 section_aid_locations[section_index] = p_articles[selected_index]->aid;  
   
717                  switch (ret)                  switch (ret)
718                  {                  {
719                  case EXIT_SECTION:                  case EXIT_SECTION:
720                            // Update current aid location
721                            if (selected_index < article_count && p_articles[selected_index] != NULL)
722                            {
723                                    if (selected_index >= ontop_start_offset)
724                                    {
725                                            ret = last_article_in_section(p_section, &p_article_locate);
726                                            if (ret < 0)
727                                            {
728                                                    log_error("last_article_in_section(sid=%d) error\n", p_section->sid);
729                                                    return -3;
730                                            }
731                                            else if (ret == 0)
732                                            {
733                                                    section_aid_locations[section_index] = 0;
734                                            }
735                                            else // ret > 0
736                                            {
737                                                    section_aid_locations[section_index] = p_article_locate->aid;
738                                            }
739                                    }
740                                    else
741                                    {
742                                            section_aid_locations[section_index] = (p_articles[selected_index]->visible ? p_articles[selected_index]->aid : 0);
743                                    }
744                            }
745                          return 0;                          return 0;
746                  case CHANGE_PAGE:                  case CHANGE_PAGE:
747                          ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);                          ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
# Line 812  int section_list_display(const char *sna Line 886  int section_list_display(const char *sna
886                                          {                                          {
887                                                  log_error("article_reply(aid=%d) error\n", p_articles[selected_index]->aid);                                                  log_error("article_reply(aid=%d) error\n", p_articles[selected_index]->aid);
888                                          }                                          }
889                                            else if (ret > 0) // Article replied
890                                            {
891                                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
892                                                    if (ret < 0)
893                                                    {
894                                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
895                                                            return -3;
896                                                    }
897                                            }
898                                          loop = 1;                                          loop = 1;
899                                          break;                                          break;
900                                  case '=':  // First topic article                                  case '=':  // First topic article
# Line 875  int section_list_display(const char *sna Line 958  int section_list_display(const char *sna
958                                  ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);                                  ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
959                                  if (ret < 0)                                  if (ret < 0)
960                                  {                                  {
961                                          log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);                                          log_error("query_section_articles(sid=%d, page_id=%d) error: %d\n", p_section->sid, page_id, ret);
962                                          return -3;                                          return -3;
963                                  }                                  }
964                          }                          }
# Line 901  int section_list_display(const char *sna Line 984  int section_list_display(const char *sna
984                          {                          {
985                                  log_error("article_modify(aid=%d) error\n", p_articles[selected_index]->aid);                                  log_error("article_modify(aid=%d) error\n", p_articles[selected_index]->aid);
986                          }                          }
987                            else if (ret > 0) // Article modified
988                            {
989                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
990                                    if (ret < 0)
991                                    {
992                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
993                                            return -3;
994                                    }
995                            }
996                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
997                          {                          {
998                                  log_error("section_list_draw_screen() error\n");                                  log_error("section_list_draw_screen() error\n");
# Line 919  int section_list_display(const char *sna Line 1011  int section_list_display(const char *sna
1011                          }                          }
1012                          else if (ret > 0) // Article deleted                          else if (ret > 0) // Article deleted
1013                          {                          {
1014                                  ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);                                  do
                                 if (ret < 0)  
1015                                  {                                  {
1016                                          log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);                                          ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
1017                                          return -3;                                          if (ret >= 0 && selected_index > article_count - 1)
1018                                  }                                          {
1019                                                    selected_index = article_count - 1;
1020                                                    break;
1021                                            }
1022                                            else if (ret < 0 && page_id > 0)
1023                                            {
1024                                                    page_id--;
1025                                                    selected_index = BBS_article_limit_per_page - 1;
1026                                            }
1027                                            else if (ret < 0 && page_id <= 0)
1028                                            {
1029                                                    selected_index = 0;
1030                                                    break;
1031                                            }
1032                                    } while (ret < 0);
1033                          }                          }
1034                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)                          if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
1035                          {                          {
# Line 944  int section_list_display(const char *sna Line 1049  int section_list_display(const char *sna
1049                          }                          }
1050                          break;                          break;
1051                  case QUERY_USER:                  case QUERY_USER:
1052                          if ((ret = query_user_info_by_uid(p_articles[selected_index]->uid, &user_info)) < 0)                          if ((ret = query_user_info_by_uid(p_articles[selected_index]->uid, &user_info, user_intro, sizeof(user_intro))) < 0)
1053                          {                          {
1054                                  log_error("query_user_info_by_uid(uid=%d) error\n", p_articles[selected_index]->uid);                                  log_error("query_user_info_by_uid(uid=%d) error\n", p_articles[selected_index]->uid);
1055                                  return -2;                                  return -2;
# Line 1010  int section_list_display(const char *sna Line 1115  int section_list_display(const char *sna
1115                                  }                                  }
1116                          }                          }
1117                          break;                          break;
1118                    case LAST_SECTION_ARTICLE:
1119                            page_id_cur = page_id;
1120                            ret = last_article_in_section(p_section, &p_article_locate);
1121                            if (ret < 0)
1122                            {
1123                                    log_error("last_article_in_section(sid=%d) error\n", p_section->sid);
1124                                    return -3;
1125                            }
1126                            else if (ret == 0)
1127                            {
1128                                    break;
1129                            }
1130                            ret = locate_article_in_section(p_section, p_article_locate, 0, 0,
1131                                                                                            &page_id, &selected_index, &article_count);
1132                            if (ret < 0)
1133                            {
1134                                    log_error("locate_article_in_section(sid=%d, aid=%d, direction=0, step=0) error\n",
1135                                                      p_section->sid, p_article_locate->aid);
1136                                    return -3;
1137                            }
1138                            else if (ret > 0 && page_id != page_id_cur) // found and page changed
1139                            {
1140                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
1141                                    if (ret < 0)
1142                                    {
1143                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
1144                                            return -3;
1145                                    }
1146                            }
1147                            break;
1148                  case SCAN_NEW_ARTICLE:                  case SCAN_NEW_ARTICLE:
1149                          ret = scan_unread_article_in_section(p_section, p_articles[selected_index], &p_article_locate);                          ret = scan_unread_article_in_section(p_section, p_articles[selected_index], &p_article_locate);
1150                          if (ret < 0)                          if (ret < 0)
# Line 1041  int section_list_display(const char *sna Line 1176  int section_list_display(const char *sna
1176                                  }                                  }
1177                          }                          }
1178                          break;                          break;
1179                    case SCAN_ARTICLE_BACKWARD_BY_USER:
1180                    case SCAN_ARTICLE_FORWARD_BY_USER:
1181                            direction = (ret == SCAN_ARTICLE_FORWARD_BY_USER ? 1 : -1);
1182                            strncpy(username, p_articles[selected_index]->username, sizeof(username) - 1);
1183                            username[sizeof(username) - 1] = '\0';
1184                            uid = 0;
1185    
1186                            moveto(SCREEN_ROWS, 1);
1187                            clrtoeol();
1188                            get_data(SCREEN_ROWS, 1,
1189                                             (direction == 1 ? "↓搜寻作者: " : "↑搜寻作者: "),
1190                                             username, sizeof(username), BBS_username_max_len);
1191    
1192                            if (username[0] == '\0')
1193                            {
1194                                    break;
1195                            }
1196    
1197                            // Verify format
1198                            for (i = 0, ok = 1; ok && username[i] != '\0'; i++)
1199                            {
1200                                    if (!(isalpha((int)username[i]) || (i > 0 && (isdigit((int)username[i]) || username[i] == '_'))))
1201                                    {
1202                                            ok = 0;
1203                                    }
1204                            }
1205                            if (ok && i > BBS_username_max_len)
1206                            {
1207                                    ok = 0;
1208                            }
1209                            if (!ok)
1210                            {
1211                                    break;
1212                            }
1213    
1214                            ret = query_user_info_by_username(username, 1, &uid, username_list);
1215                            if (ret < 0)
1216                            {
1217                                    log_error("query_user_info_by_username(%s) error\n", username);
1218                                    break;
1219                            }
1220    
1221                            if (uid > 0)
1222                            {
1223                                    ret = scan_article_in_section_by_uid(p_section, p_articles[selected_index],
1224                                                                                                             direction, uid, &p_article_locate);
1225                                    if (ret < 0)
1226                                    {
1227                                            log_error("scan_article_in_section_by_uid(sid=%d, aid=%d, direction=%d, uid=%d) error\n",
1228                                                              p_section->sid, p_articles[selected_index]->aid, direction, uid);
1229                                            return -3;
1230                                    }
1231                                    else if (ret == 0) // not found
1232                                    {
1233                                            break;
1234                                    }
1235                            }
1236                            else // uid == 0
1237                            {
1238                                    ret = scan_article_in_section_by_username(p_section, p_articles[selected_index],
1239                                                                                                                      direction, username, &p_article_locate);
1240                                    if (ret < 0)
1241                                    {
1242                                            log_error("scan_article_in_section_by_username(sid=%d, aid=%d, direction=%d, username=%s) error\n",
1243                                                              p_section->sid, p_articles[selected_index]->aid, direction, username);
1244                                            return -3;
1245                                    }
1246                                    else if (ret == 0) // not found
1247                                    {
1248                                            break;
1249                                    }
1250                            }
1251    
1252                            page_id_cur = page_id;
1253                            ret = locate_article_in_section(p_section, p_article_locate, 0, 0,
1254                                                                                            &page_id, &selected_index, &article_count);
1255                            if (ret < 0)
1256                            {
1257                                    log_error("locate_article_in_section(sid=%d, aid=%d, direction=0, step=0) error\n",
1258                                                      p_section->sid, p_article_locate->aid);
1259                                    return -3;
1260                            }
1261                            else if (ret > 0 && page_id != page_id_cur) // found and page changed
1262                            {
1263                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
1264                                    if (ret < 0)
1265                                    {
1266                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
1267                                            return -3;
1268                                    }
1269                            }
1270                            break;
1271                    case SCAN_ARTICLE_BACKWARD_BY_TITLE:
1272                    case SCAN_ARTICLE_FORWARD_BY_TITLE:
1273                            direction = (ret == SCAN_ARTICLE_FORWARD_BY_TITLE ? 1 : -1);
1274    
1275                            moveto(SCREEN_ROWS, 1);
1276                            clrtoeol();
1277                            get_data(SCREEN_ROWS, 1,
1278                                             (direction == 1 ? "↓搜寻标题: " : "↑搜寻标题: "),
1279                                             title, sizeof(title), TITLE_SEARCH_MAX_LEN);
1280    
1281                            if (title[0] == '\0')
1282                            {
1283                                    break;
1284                            }
1285    
1286                            ret = scan_article_in_section_by_title(p_section, p_articles[selected_index],
1287                                                                                                       direction, title, &p_article_locate);
1288                            if (ret < 0)
1289                            {
1290                                    log_error("scan_article_in_section_by_title(sid=%d, aid=%d, direction=%d, title=%s) error\n",
1291                                                      p_section->sid, p_articles[selected_index]->aid, direction, title);
1292                                    return -3;
1293                            }
1294                            else if (ret == 0) // not found
1295                            {
1296                                    break;
1297                            }
1298    
1299                            page_id_cur = page_id;
1300                            ret = locate_article_in_section(p_section, p_article_locate, 0, 0,
1301                                                                                            &page_id, &selected_index, &article_count);
1302                            if (ret < 0)
1303                            {
1304                                    log_error("locate_article_in_section(sid=%d, aid=%d, direction=0, step=0) error\n",
1305                                                      p_section->sid, p_article_locate->aid);
1306                                    return -3;
1307                            }
1308                            else if (ret > 0 && page_id != page_id_cur) // found and page changed
1309                            {
1310                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
1311                                    if (ret < 0)
1312                                    {
1313                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
1314                                            return -3;
1315                                    }
1316                            }
1317                            break;
1318                    case SEARCH_USER:
1319                            user_list_search();
1320                            if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0)
1321                            {
1322                                    log_error("section_list_draw_screen() error\n");
1323                                    return -2;
1324                            }
1325                            break;
1326                  case SHOW_HELP:                  case SHOW_HELP:
1327                          // Display help information                          // Display help information
1328                          display_file(DATA_READ_HELP, 1);                          display_file(DATA_READ_HELP, 1);
# Line 1081  int section_list_ex_dir_display(SECTION_ Line 1363  int section_list_ex_dir_display(SECTION_
1363  {  {
1364          MENU_SET ex_menu_set;          MENU_SET ex_menu_set;
1365          int ch = 0;          int ch = 0;
1366            int loop;
1367    
1368          if (p_section == NULL)          if (p_section == NULL)
1369          {          {
# Line 1113  int section_list_ex_dir_display(SECTION_ Line 1396  int section_list_ex_dir_display(SECTION_
1396    
1397          if (display_menu(&ex_menu_set) == 0)          if (display_menu(&ex_menu_set) == 0)
1398          {          {
1399                  while (!SYS_server_exit)                  for (loop = 1; !SYS_server_exit && loop;)
1400                  {                  {
1401                          iflush();                          iflush();
1402                          ch = igetch(100);                          ch = igetch(100);
# Line 1121  int section_list_ex_dir_display(SECTION_ Line 1404  int section_list_ex_dir_display(SECTION_
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_error("KEY_NULL\n");
1419                                  return 0;                                  loop = 0;
1420                                    break;
1421                          case KEY_TIMEOUT:                          case KEY_TIMEOUT:
1422                                  if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)                                  if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time)
1423                                  {                                  {
1424                                          log_error("User input timeout\n");                                          log_error("User input timeout\n");
1425                                          return 0;                                          loop = 0;
1426                                            break;
1427                                  }                                  }
1428                                  continue;                                  continue;
1429                          case CR:                          case CR:
# Line 1140  int section_list_ex_dir_display(SECTION_ Line 1431  int section_list_ex_dir_display(SECTION_
1431                                  switch (menu_control(&ex_menu_set, ch))                                  switch (menu_control(&ex_menu_set, ch))
1432                                  {                                  {
1433                                  case EXITMENU:                                  case EXITMENU:
1434                                          ch = EXITMENU;                                          loop = 0;
1435                                          break;                                          break;
1436                                  case REDRAW:                                  case REDRAW:
1437                                          clearscr();                                          clearscr();
# Line 1153  int section_list_ex_dir_display(SECTION_ Line 1444  int section_list_ex_dir_display(SECTION_
1444                                          break;                                          break;
1445                                  }                                  }
1446                          }                          }
   
                         if (ch == EXITMENU)  
                         {  
                                 break;  
                         }  
1447                  }                  }
1448          }          }
1449    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1