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

Diff of /lbbs/src/article_post.c

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

Revision 1.32 by sysadm, Fri Oct 10 12:31:15 2025 UTC Revision 1.37 by sysadm, Tue Nov 4 13:49:51 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                  article_post.c  -  description  /*
3                                                           -------------------   * article_post
4          copyright            : (C) 2004-2025 by Leaflet   *   - user interactive feature to post / modify / reply article
5          email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>
7     */
 /***************************************************************************  
  *                                                                         *  
  *   This program is free software; you can redistribute it and/or modify  *  
  *   it under the terms of the GNU General Public License as published by  *  
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
8    
9  #include "article_cache.h"  #include "article_cache.h"
10  #include "article_post.h"  #include "article_post.h"
# Line 32  Line 24 
24  #define TITLE_INPUT_MAX_LEN 72  #define TITLE_INPUT_MAX_LEN 72
25  #define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB  #define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB
26  #define ARTICLE_QUOTE_MAX_LINES 20  #define ARTICLE_QUOTE_MAX_LINES 20
 #define ARTICLE_QUOTE_LINE_MAX_LEN 76  
27    
28  #define MODIFY_DT_MAX_LEN 50  #define MODIFY_DT_MAX_LEN 50
29    
# Line 119  int article_post(const SECTION_LIST *p_s Line 110  int article_post(const SECTION_LIST *p_s
110                          case KEY_TIMEOUT:                          case KEY_TIMEOUT:
111                                  goto cleanup;                                  goto cleanup;
112                          case CR:                          case CR:
                                 igetch_reset();  
113                                  break;                                  break;
114                          case 'T':                          case 'T':
115                                  len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN);                                  len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN);
# Line 183  int article_post(const SECTION_LIST *p_s Line 173  int article_post(const SECTION_LIST *p_s
173                                  case KEY_TIMEOUT:                                  case KEY_TIMEOUT:
174                                          goto cleanup;                                          goto cleanup;
175                                  case CR:                                  case CR:
                                         igetch_reset();  
176                                  case 'S':                                  case 'S':
177                                          break;                                          break;
178                                  case 'C':                                  case 'C':
# Line 534  int article_modify(const SECTION_LIST *p Line 523  int article_modify(const SECTION_LIST *p
523                          case KEY_TIMEOUT:                          case KEY_TIMEOUT:
524                                  goto cleanup;                                  goto cleanup;
525                          case CR:                          case CR:
                                 igetch_reset();  
526                          case 'S':                          case 'S':
527                                  break;                                  break;
528                          case 'C':                          case 'C':
# Line 854  int article_reply(const SECTION_LIST *p_ Line 842  int article_reply(const SECTION_LIST *p_
842                  }                  }
843    
844                  // Apply LML render to content body                  // Apply LML render to content body
845                  len = lml_render(row[1], content_f, ARTICLE_CONTENT_MAX_LEN, 0);                  len = lml_render(row[1], content_f, ARTICLE_CONTENT_MAX_LEN, MAX_EDITOR_DATA_LINE_LENGTH - 3, 1);
846                  content_f[len] = '\0';                  content_f[len] = '\0';
847    
848                  // Remove control sequence                  // Remove control sequence
# Line 864  int article_reply(const SECTION_LIST *p_ Line 852  int article_reply(const SECTION_LIST *p_
852                                             "\n\n【 在 %s (%s) 的大作中提到: 】\n",                                             "\n\n【 在 %s (%s) 的大作中提到: 】\n",
853                                             p_article->username, p_article->nickname);                                             p_article->username, p_article->nickname);
854    
855                  quote_content_lines = split_data_lines(content_f, ARTICLE_QUOTE_LINE_MAX_LEN, line_offsets, ARTICLE_QUOTE_MAX_LINES + 1, 0, NULL);                  quote_content_lines = split_data_lines(content_f, MAX_EDITOR_DATA_LINE_LENGTH - 2, line_offsets, ARTICLE_QUOTE_MAX_LINES + 1, 0, NULL);
856                  for (i = 0; i < quote_content_lines; i++)                  for (i = 0; i < quote_content_lines; i++)
857                  {                  {
858                          memcpy(content + len, ": ", 2); // quote line prefix                          memcpy(content + len, ": ", 2); // quote line prefix
# Line 934  int article_reply(const SECTION_LIST *p_ Line 922  int article_reply(const SECTION_LIST *p_
922                          case KEY_TIMEOUT:                          case KEY_TIMEOUT:
923                                  goto cleanup;                                  goto cleanup;
924                          case CR:                          case CR:
                                 igetch_reset();  
925                                  break;                                  break;
926                          case 'T':                          case 'T':
927                                  len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN);                                  len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN);
# Line 995  int article_reply(const SECTION_LIST *p_ Line 982  int article_reply(const SECTION_LIST *p_
982                                  case KEY_TIMEOUT:                                  case KEY_TIMEOUT:
983                                          goto cleanup;                                          goto cleanup;
984                                  case CR:                                  case CR:
                                         igetch_reset();  
985                                  case 'S':                                  case 'S':
986                                          break;                                          break;
987                                  case 'C':                                  case 'C':


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

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