--- lbbs/src/article_post.c 2025/10/10 03:50:22 1.29 +++ lbbs/src/article_post.c 2025/11/04 14:58:56 1.38 @@ -1,18 +1,10 @@ -/*************************************************************************** - article_post.c - description - ------------------- - copyright : (C) 2004-2025 by Leaflet - email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * 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. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * article_post + * - user interactive feature to post / modify / reply article + * + * Copyright (C) 2004-2025 Leaflet + */ #include "article_cache.h" #include "article_post.h" @@ -32,7 +24,6 @@ #define TITLE_INPUT_MAX_LEN 72 #define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB #define ARTICLE_QUOTE_MAX_LINES 20 -#define ARTICLE_QUOTE_LINE_MAX_LEN 76 #define MODIFY_DT_MAX_LEN 50 @@ -90,7 +81,7 @@ int article_post(const SECTION_LIST *p_s { clearscr(); moveto(21, 1); - prints("发表文章于 %s[%s] 讨论区,类型: %s,通知:%s", + prints("发表文章于 %s[%s] 讨论区,类型: %s,回复通知:%s", p_section->stitle, p_section->sname, (p_article_new->transship ? "转载" : "原创"), (reply_note ? "开启" : "关闭")); @@ -106,7 +97,7 @@ int article_post(const SECTION_LIST *p_s moveto(24, 1); prints("T改标题, C取消, Z设为%s, N%s, Enter继续: ", (p_article_new->transship ? "原创" : "转载"), - (reply_note ? "通知关闭" : "通知开启")); + (reply_note ? "关闭回复通知" : "开启回复通知")); iflush(); ch = 0; } @@ -119,7 +110,6 @@ int article_post(const SECTION_LIST *p_s case KEY_TIMEOUT: goto cleanup; case CR: - igetch_reset(); break; case 'T': len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); @@ -183,7 +173,6 @@ int article_post(const SECTION_LIST *p_s case KEY_TIMEOUT: goto cleanup; case CR: - igetch_reset(); case 'S': break; case 'C': @@ -523,7 +512,7 @@ int article_modify(const SECTION_LIST *p { clearscr(); moveto(1, 1); - prints("(S)保存, (C)取消, (N)通知%s or (E)再编辑? [S]: ", + prints("(S)保存, (C)取消, (N)%s回复通知 or (E)再编辑? [S]: ", (reply_note ? "关闭" : "开启")); iflush(); @@ -534,7 +523,6 @@ int article_modify(const SECTION_LIST *p case KEY_TIMEOUT: goto cleanup; case CR: - igetch_reset(); case 'S': break; case 'C': @@ -734,7 +722,7 @@ int article_reply(const SECTION_LIST *p_ int content_display_length; char nickname_f[BBS_nickname_max_len * 2 + 1]; int sign_id = 0; - int reply_note = 1; + int reply_note = 0; long len; int ch; char *p, *q; @@ -854,7 +842,7 @@ int article_reply(const SECTION_LIST *p_ } // Apply LML render to content body - 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); content_f[len] = '\0'; // Remove control sequence @@ -864,7 +852,7 @@ int article_reply(const SECTION_LIST *p_ "\n\n【 在 %s (%s) 的大作中提到: 】\n", p_article->username, p_article->nickname); - 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); for (i = 0; i < quote_content_lines; i++) { memcpy(content + len, ": ", 2); // quote line prefix @@ -909,7 +897,7 @@ int article_reply(const SECTION_LIST *p_ { clearscr(); moveto(21, 1); - prints("回复文章于 %s[%s] 讨论区,通知:%s", p_section->stitle, p_section->sname, (reply_note ? "开启" : "关闭")); + prints("回复文章于 %s[%s] 讨论区,回复通知:%s", p_section->stitle, p_section->sname, (reply_note ? "开启" : "关闭")); moveto(22, 1); prints("标题: %s", (p_article_new->title[0] == '\0' ? "[无]" : p_article_new->title)); moveto(23, 1); @@ -921,7 +909,7 @@ int article_reply(const SECTION_LIST *p_ moveto(24, 1); prints("T改标题, C取消, N%s, Enter继续: ", - (reply_note ? "通知关闭" : "通知开启")); + (reply_note ? "关闭回复通知" : "开启回复通知")); iflush(); ch = 0; } @@ -934,7 +922,6 @@ int article_reply(const SECTION_LIST *p_ case KEY_TIMEOUT: goto cleanup; case CR: - igetch_reset(); break; case 'T': len = get_data(24, 1, "标题: ", title_input, sizeof(title_input), TITLE_INPUT_MAX_LEN); @@ -995,7 +982,6 @@ int article_reply(const SECTION_LIST *p_ case KEY_TIMEOUT: goto cleanup; case CR: - igetch_reset(); case 'S': break; case 'C': @@ -1211,7 +1197,7 @@ int article_reply(const SECTION_LIST *p_ { // Send notification message len_msg = snprintf(msg, BBS_msg_max_len, - "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的文章,快来" + "有人回复了您所发表/回复的文章,快来" "[article %d]看看[/article]《%s》吧!\n", p_article_new->aid, title_f);