Author: jflesch
Date: 2007-08-20 22:17:53 +0000 (Mon, 20 Aug 2007)
New Revision: 14815

Modified:
   trunk/apps/Thaw/src/thaw/plugins/Hsqldb.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java
Log:
Set the idLinePos and the idLineLen in the frost messages correctly (at least 
try to ...)

Modified: trunk/apps/Thaw/src/thaw/plugins/Hsqldb.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/Hsqldb.java        2007-08-20 20:18:39 UTC 
(rev 14814)
+++ trunk/apps/Thaw/src/thaw/plugins/Hsqldb.java        2007-08-20 22:17:53 UTC 
(rev 14815)
@@ -69,6 +69,7 @@
        public void disconnect() throws java.sql.SQLException {
                synchronized(dbLock) {
                        connection.close();
+                       connection = null;
                }
        }


Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java  2007-08-20 
20:18:39 UTC (rev 14814)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java  2007-08-20 
22:17:53 UTC (rev 14815)
@@ -421,6 +421,17 @@

                        String txt = textArea.getText();

+                       int idLineLen = 
authorBox.getSelectedItem().toString().length();
+                       int idLinePos = txt.indexOf("$sender$");
+
+                       if (idLinePos <= -1) {
+                               idLinePos = 0;
+                               idLineLen = 0;
+                       }
+
+                       draft.setIdLinePos(idLinePos);
+                       draft.setIdLineLen(idLineLen);
+
                        txt = txt.replaceAll("\\$sender\\$", 
authorBox.getSelectedItem().toString());

                        String dateStr = 
messageDateFormat.format(date).toString();

Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java   
2007-08-20 20:18:39 UTC (rev 14814)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java   
2007-08-20 22:17:53 UTC (rev 14815)
@@ -27,6 +27,9 @@
        private Identity identity;
        private Date date;

+       private int idLinePos = 0;
+       private int idLineLen = 0;
+
        private Vector attachments;


@@ -120,6 +123,15 @@
        }


+       public void setIdLinePos(int i) {
+               idLinePos = i;
+       }
+
+       public void setIdLineLen(int i) {
+               idLineLen = i;
+       }
+
+
        private static boolean initialInsertion = false;

        public void post(FCPQueueManager queueManager) {
@@ -148,8 +160,10 @@
                                                                          
((identity != null) ?
                                                                           
identity.getPublicKey() :
                                                                           
null),
-                                                                         
attachments,
-                                                                         
identity);
+                                                                          
attachments,
+                                                                          
identity,
+                                                                          
idLinePos,
+                                                                          
idLineLen);

                        fileToInsert = generator.generateXML();
                }

Modified: 
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java   
2007-08-20 20:18:39 UTC (rev 14814)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java   
2007-08-20 22:17:53 UTC (rev 14815)
@@ -76,7 +76,9 @@
                                String body,
                                String publicKey,
                                Vector attachments,
-                               Identity identity) {
+                               Identity identity,
+                               int idLinePos,
+                               int idLineLen) {
                this();

                this.messageId = ""; /* will be generated from the SHA1 of the 
content */
@@ -93,8 +95,8 @@
                this.board = board;
                this.body = body;
                this.publicKey = publicKey;
-               this.idLinePos = "0";
-               this.idLineLen = "0";
+               this.idLinePos = Integer.toString(idLinePos);
+               this.idLineLen = Integer.toString(idLineLen);

                this.attachments = attachments;


Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java    
2007-08-20 20:18:39 UTC (rev 14814)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java    
2007-08-20 22:17:53 UTC (rev 14815)
@@ -41,6 +41,18 @@
         */
        public void setDate(java.util.Date date);

+       /**
+        * @param i specify the position of the id line in the text
+        */
+       public void setIdLinePos(int i);
+
+
+       /**
+        * @param i specify the length of the id line in the text
+        */
+       public void setIdLineLen(int i);
+
+
        public boolean addAttachment(java.io.File file);
        public boolean addAttachment(Board board);
        public boolean addAttachment(thaw.plugins.index.Index index);


Reply via email to