From 09f05e19e3fdd9f151fae7d8d3d8ed22b47551e2 Mon Sep 17 00:00:00 2001
From: Joel Rosdahl <joel@rosdahl.net>
Date: Sat, 23 Mar 2002 19:54:52 +0000
Subject: [PATCH] Fix bug 422:

* commands1.el (lyskom-private-answer): Print informative text if
replying to Anonymous user.

* english-strings.el, swedish-strings.el (lyskom-message): Added
personal-comment-to-anonymous string.

* commands1.el (lyskom-private-answer-soon-prev): Removed unused
function.
---
 src/ChangeLog          | 13 ++++++++
 src/commands1.el       | 70 +++++++++++++++++++-----------------------
 src/english-strings.el |  2 ++
 src/swedish-strings.el |  4 ++-
 4 files changed, 49 insertions(+), 40 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 9e419589..16372aef 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2002-03-23  Joel Rosdahl  <joel@lysator.liu.se>
+
+	Fix bug 422:
+
+	* commands1.el (lyskom-private-answer): Print informative text if
+	replying to Anonymous user.
+
+	* english-strings.el, swedish-strings.el (lyskom-message): Added
+	personal-comment-to-anonymous string.
+
+	* commands1.el (lyskom-private-answer-soon-prev): Removed unused
+	function.
+
 2002-03-21  Joel Rosdahl  <joel@lysator.liu.se>
 
 	Fiddled with various release-related things. Fixes bugs 298, 299
diff --git a/src/commands1.el b/src/commands1.el
index 19c34573..3ae2fc12 100644
--- a/src/commands1.el
+++ b/src/commands1.el
@@ -1101,36 +1101,37 @@ that text instead."
 
 (defun lyskom-private-answer (text-stat subject)
   "Write a private answer. Args: TEXT-STAT SUBJECT."
-  (if (null text-stat)
-      (progn
-	(lyskom-insert-string 'confusion-what-to-answer-to))
-    (progn
-      (lyskom-tell-internat 'kom-tell-write-reply)
-      (cache-del-conf-stat (text-stat->author text-stat))
-      (let* ((conf-stat (blocking-do 'get-conf-stat
-                                     (text-stat->author text-stat))))
-        (if (if (zerop (conf-stat->msg-of-day conf-stat))
-                t
-              (progn
-                (recenter 1)
-                (lyskom-format-insert 'has-motd 
-                                      conf-stat)
-                (lyskom-view-text (conf-stat->msg-of-day conf-stat))
-                (if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
-                    t
-                  nil)))
-            (if (= (text-stat->author text-stat) lyskom-pers-no)
-                (lyskom-edit-text lyskom-proc
-                                  (lyskom-create-misc-list 'recpt 
-                                                           (text-stat->author text-stat))
-                                  "" "")
-              (lyskom-edit-text lyskom-proc
-                                (lyskom-create-misc-list
-                                 'comm-to (text-stat->text-no text-stat)
-                                 'recpt (text-stat->author text-stat)
-                                 'recpt lyskom-pers-no)
-                                subject ""))))
-      )))
+  (cond ((null text-stat)
+         (lyskom-insert-string 'confusion-what-to-answer-to))
+        ((= (text-stat->author text-stat) 0)
+         (lyskom-insert-string 'personal-comment-to-anonymous))
+        (t
+         (lyskom-tell-internat 'kom-tell-write-reply)
+         (cache-del-conf-stat (text-stat->author text-stat))
+         (let* ((conf-stat (blocking-do 'get-conf-stat
+                                        (text-stat->author text-stat))))
+           (if (if (zerop (conf-stat->msg-of-day conf-stat))
+                   t
+                 (progn
+                   (recenter 1)
+                   (lyskom-format-insert 'has-motd
+                                         conf-stat)
+                   (lyskom-view-text (conf-stat->msg-of-day conf-stat))
+                   (if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
+                       t
+                     nil)))
+               (if (= (text-stat->author text-stat) lyskom-pers-no)
+                   (lyskom-edit-text lyskom-proc
+                                     (lyskom-create-misc-list
+                                      'recpt
+                                      (text-stat->author text-stat))
+                                     "" "")
+                 (lyskom-edit-text lyskom-proc
+                                   (lyskom-create-misc-list
+                                    'comm-to (text-stat->text-no text-stat)
+                                    'recpt (text-stat->author text-stat)
+                                    'recpt lyskom-pers-no)
+                                   subject "")))))))
 
 
 ;;; ================================================================
@@ -1153,15 +1154,6 @@ that text instead."
     (lyskom-insert-string 'confusion-who-to-reply-to)))
 
 
-(defun lyskom-private-answer-soon-prev (text-stat text)
-  "Write a private answer to TEXT-STAT, TEXT."
-  (let ((str (text->decoded-text-mass text text-stat)))
-  (if (string-match "\n" str)
-      (lyskom-private-answer text-stat
-			     (substring str 0 (match-beginning 0)))
-    (lyskom-private-answer text-stat ""))))
-
-
 ;;; ================================================================
 ;;;                         Sluta - quit
 
diff --git a/src/english-strings.el b/src/english-strings.el
index 76a2b324..e6a0776e 100644
--- a/src/english-strings.el
+++ b/src/english-strings.el
@@ -547,6 +547,8 @@ Read all about it at http://www.lysator.liu.se/history/")
     (who-is-active-and-member . "Only members in %#1M are shown.\n")
     (who-is-active-and-present . "Only members present in %#1M are shown.\n")
 
+    (personal-comment-to-anonymous . "It is not possible to write a personal comment to an anonymous text.\n")
+
     ;; Used for kom-is-person-member-of-conference:
     (pers-to-check-mship-for . "Whose membership do you want to check? ") ;-)
     (conf-to-check-mship-of . "...for what conference? ")
diff --git a/src/swedish-strings.el b/src/swedish-strings.el
index 10a81adc..c6129b64 100644
--- a/src/swedish-strings.el
+++ b/src/swedish-strings.el
@@ -535,7 +535,9 @@ i svensk datorhistoria. L
     (who-is-present-in-what-conference . "Vilka n�rvarande i vilket m�te: ")
     (who-is-active-and-member . "Visar endast medlemmar i %#1M.\n")
     (who-is-active-and-present . "Visar endast medlemmar n�rvarande i %#1M.\n")
-    
+
+    (personal-comment-to-anonymous . "Det g�r inte att skriva ett personligt svar till ett anonymt inl�gg.\n")
+
     ;; From commands2.el:
 
     (your-memberships . "Ditt medlemskap i olika KOM-m�ten:\n")
-- 
GitLab