/[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.44 by sysadm, Wed Oct 1 08:58:25 2025 UTC Revision 1.45 by sysadm, Sat Oct 4 03:21:59 2025 UTC
# Line 49  enum select_cmd_t Line 49  enum select_cmd_t
49          QUERY_ARTICLE,          QUERY_ARTICLE,
50          FIRST_TOPIC_ARTICLE,          FIRST_TOPIC_ARTICLE,
51          LAST_TOPIC_ARTICLE,          LAST_TOPIC_ARTICLE,
52            SCAN_NEW_ARTICLE,
53          VIEW_EX_DIR,          VIEW_EX_DIR,
54  };  };
55    
# Line 352  static enum select_cmd_t section_list_se Line 353  static enum select_cmd_t section_list_se
353                                  return LAST_TOPIC_ARTICLE;                                  return LAST_TOPIC_ARTICLE;
354                          }                          }
355                          break;                          break;
356                    case 'S':
357                            if (item_count > 0)
358                            {
359                                    return SCAN_NEW_ARTICLE;
360                            }
361                            break;
362                  case 'h':                  case 'h':
363                          return SHOW_HELP;                          return SHOW_HELP;
364                  case 'x':                  case 'x':
# Line 498  int section_list_display(const char *sna Line 505  int section_list_display(const char *sna
505          int direction;          int direction;
506          ARTICLE article_new;          ARTICLE article_new;
507          int page_id_cur;          int page_id_cur;
508            const ARTICLE *p_article_unread;
509    
510          p_section = section_list_find_by_name(sname);          p_section = section_list_find_by_name(sname);
511          if (p_section == NULL)          if (p_section == NULL)
# Line 854  int section_list_display(const char *sna Line 862  int section_list_display(const char *sna
862                                  return -3;                                  return -3;
863                          }                          }
864                          else if (ret > 0 && page_id != page_id_cur) // found and page changed                          else if (ret > 0 && page_id != page_id_cur) // found and page changed
865                            {
866                                    ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count, &ontop_start_offset);
867                                    if (ret < 0)
868                                    {
869                                            log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id);
870                                            return -3;
871                                    }
872                            }
873                            break;
874                    case SCAN_NEW_ARTICLE:
875                            ret = scan_unread_article_in_section(p_section, p_articles[selected_index], &p_article_unread);
876                            if (ret < 0)
877                            {
878                                    log_error("scan_unread_article_in_section(sid=%d, aid=%d) error\n",
879                                                      p_section->sid, p_articles[selected_index]->aid);
880                                    return -3;
881                            }
882                            else if (ret == 0) // not found
883                            {
884                                    break;
885                            }
886                            page_id_cur = page_id;
887                            ret = locate_article_in_section(p_section, p_article_unread, 0, 0,
888                                                                                            &page_id, &selected_index, &article_count);
889                            if (ret < 0)
890                            {
891                                    log_error("locate_article_in_section(sid=%d, aid=%d, direction=0, step=0) error\n",
892                                                      p_section->sid, p_article_unread->aid);
893                                    return -3;
894                            }
895                            else if (ret > 0 && page_id != page_id_cur) // found and page changed
896                          {                          {
897                                  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);
898                                  if (ret < 0)                                  if (ret < 0)


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

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