[Pkg-mozext-commits] [nostalgy] 97/252: *** empty log message ***

David Prévot taffit at moszumanska.debian.org
Tue Jun 14 15:24:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository nostalgy.

commit fe4e768a537eb1cb666abbf156dda668028ad65c
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Wed May 30 13:30:54 2007 +0000

    *** empty log message ***
---
 content/edit_prefs.js | 36 +++++++++++++++++++++++++++---------
 content/nostalgy.js   |  6 +++++-
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/content/edit_prefs.js b/content/edit_prefs.js
index be16589..4833726 100644
--- a/content/edit_prefs.js
+++ b/content/edit_prefs.js
@@ -22,8 +22,8 @@ var nost_js_quote = {
 
 String.prototype.quote = function () {
   var x = this;
-  if (/["\\\x00-\x1f"]/.test(this)) {
-    x = this.replace(/(["\x00-\x1f\\"])/g, function(a, b) {
+  if (/["\x00-\x20\\"]/.test(this)) {
+    x = this.replace(/(["\x00-\x20\\"])/g, function(a, b) {
       var c = nost_js_quote[b];
       if (c) { return c; }
       c = b.charCodeAt();
@@ -34,6 +34,23 @@ String.prototype.quote = function () {
   return '"' + x + '"';
 };
 
+/*
+String.prototype.escape_spaces = function() {
+  return this.replace(/([\x20_])/g, function(a,b) {
+    if (b = " ") return "_";
+    else return "\\_"
+  });
+}
+
+String.prototype.unescape_spaces = function() {
+  return this.replace(/(_|\\_)/g, function(a,b) {
+    if (b = "_") return " ";
+    else return "_"
+  });
+}
+*/
+
+
 function NostalgySendRules() {
   var sAccountManager = 
     Components.classes["@mozilla.org/messenger/account-manager;1"].
@@ -67,7 +84,8 @@ function NostalgySendRules() {
   
   compfields.to = to;
   compfields.subject = "Nostalgy Rules from " + identity.fullName;
-  compfields.body = "This e-mail was automatically generated by Nostalgy (Thunderbird Extension). It stores a set of Nostalgy rules.\nIf you read this message under Thunderbird, with Nostalgy installed, you can import these rules by clicking on the 'Extract Nostalgy rules' button that should appear above.\n\nFor more information about Nostalgy: http://alain.frisch.fr/soft_mozilla.html\n\nBEGIN RULES\n" + MkPrefStr() + "\nEND RULES\n\n";
+  var rules = MkPrefStr();
+  compfields.body = "This e-mail was automatically generated by Nostalgy (Thunderbird Extension). It stores a set of Nostalgy rules.\nIf you read this message under Thunderbird, with Nostalgy installed, you can import these rules by clicking on the 'Extract Nostalgy rules' button that should appear above.\n\nFor more information about Nostalgy: http://alain.frisch.fr/soft_mozilla.html\n\nBEGIN RULES\n" + rules + "\nEND RULES\n\n";
   
   params.identity = identity;
   params.composeFields = compfields;
@@ -140,12 +158,12 @@ function CreateItem(rule) {
 
 function StrOfRule(rule) {
   return (
-   "{sender:  "   + rule.sender           + "," +
-   " recipients: "+ rule.recipients       + "," +
-   " subject:   " + rule.subject          + "," +
-   " contains:  " + rule.contains.quote() + "," +
-   " under:  "    + rule.under.quote()    + "," +
-   " folder:  "   + rule.folder.quote()   + "}"
+   "{sender:"   + rule.sender           + "," +
+   "recipients:"+ rule.recipients       + "," +
+   "subject:" + rule.subject          + "," +
+   "contains:" + rule.contains.quote() + "," +
+   "under:"    + rule.under.quote()    + "," +
+   "folder:"   + rule.folder.quote()   + "}"
   );
 }
 
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 939c895..98c7b7c 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -143,6 +143,10 @@ NostalgyRules.register();
 function NostalgyExtractRules() {
   var s = nostalgy_extracted_rules;
   if (s == "") return;
+  // remove whitespaces. they should have been escaped as \u0020
+  NostalgyDebug("before whitespace removal:" + s);
+  s = s.replace(/([\x00-\x20])/g,function(a,b){ return "" });
+  NostalgyDebug("after whitespace removal:" + s);
   if (confirm(
 "Do you want to install the rules contained in this message?\n"+
 "This will overwrite your current set of rules.\n"+
@@ -327,7 +331,7 @@ var NostalgyObserver = {
 function onNostalgyUnload() {
  var mSession = NostalgyMailSession();
  if (mSession) mSession.RemoveFolderListener(NostalgyFolderListener);
-
+ NostalgyRules.unregister();
  /*
  Components.classes["@mozilla.org/observer-service;1"].
    getService(Components.interfaces.nsIObserverService).

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git



More information about the Pkg-mozext-commits mailing list