xi-conversations

Minimal clone of thunderbird conversations
git clone https://git.ce9e.org/xi-conversations.git

commit
dfa269255faa026cb04e6ea1d138855bed10ae68
parent
0f951a63501fc153db8c3aecd5551ee346b93272
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-09-28 19:58
Revert e46f29e5 and 0b18f3b4

Diffstat

M content/main.html 1 -
M experiment-api/api.js 15 ---------------
M experiment-api/schema.json 22 ----------------------
M src/js/main.js 16 ----------------

4 files changed, 0 insertions, 54 deletions


diff --git a/content/main.html b/content/main.html

@@ -63,7 +63,6 @@
   63    63 							{{#attachments}}
   64    64 								<li>
   65    65 									<a class="attachment" href="{{ url }}">{{#icon}}x-attachment{{/icon}} {{ name }}</a>
   66    -1 									(<a class="attachment-save" href="{{ url }}">save</a>)
   67    66 								</li>
   68    67 							{{/attachments}}
   69    68 						</ul>

diff --git a/experiment-api/api.js b/experiment-api/api.js

@@ -86,21 +86,6 @@ var xi = class extends ExtensionCommon.ExtensionAPI {
   86    86 						}, false, {examineEncryptedParts: true});
   87    87 					});
   88    88 				},
   89    -1 				async openAttachment(id, url) {
   90    -1 					// https://bugzilla.mozilla.org/show_bug.cgi?id=1696777
   91    -1 					var msgHdr = context.extension.messageManager.get(id);
   92    -1 					var win = Services.wm.getMostRecentWindow('mail:3pane');
   93    -1 					var params = getParams(url.split('?')[1] || '');
   94    -1 					var attInfo = new win.AttachmentInfo(null, url, params.filename, msg2uri(msgHdr));
   95    -1 					attInfo.open();
   96    -1 				},
   97    -1 				async saveAttachment(id, url) {
   98    -1 					var msgHdr = context.extension.messageManager.get(id);
   99    -1 					var win = Services.wm.getMostRecentWindow('mail:3pane');
  100    -1 					var params = getParams(url.split('?')[1] || '');
  101    -1 					var attInfo = new win.AttachmentInfo(null, url, params.filename, msg2uri(msgHdr));
  102    -1 					attInfo.save();
  103    -1 				},
  104    89 				viewSource(id) {
  105    90 					var win = Services.wm.getMostRecentWindow('mail:3pane');
  106    91 					var msgHdr = context.extension.messageManager.get(id);

diff --git a/experiment-api/schema.json b/experiment-api/schema.json

@@ -20,28 +20,6 @@
   20    20 			"type": "integer"
   21    21 		}]
   22    22 	}, {
   23    -1 		"name": "openAttachment",
   24    -1 		"type": "function",
   25    -1 		"async": true,
   26    -1 		"parameters": [{
   27    -1 			"name": "id",
   28    -1 			"type": "integer"
   29    -1 		}, {
   30    -1 			"name": "url",
   31    -1 			"type": "string"
   32    -1 		}]
   33    -1 	}, {
   34    -1 		"name": "saveAttachment",
   35    -1 		"type": "function",
   36    -1 		"async": true,
   37    -1 		"parameters": [{
   38    -1 			"name": "id",
   39    -1 			"type": "integer"
   40    -1 		}, {
   41    -1 			"name": "url",
   42    -1 			"type": "string"
   43    -1 		}]
   44    -1 	}, {
   45    23 		"name": "viewSource",
   46    24 		"type": "function",
   47    25 		"async": false,

diff --git a/src/js/main.js b/src/js/main.js

@@ -32,19 +32,3 @@ browser.xi.getConversation(initialIDs).then(function(conversation) {
   32    32 		anyExpanded = anyExpanded || expanded;
   33    33 	}
   34    34 });
   35    -1 
   36    -1 document.addEventListener('click', function(event) {
   37    -1 	if (event.target.matches('a.attachment')) {
   38    -1 		event.preventDefault();
   39    -1 		var id = parseInt(event.target.closest('[id^="msg-"]').id.substr(4), 10);
   40    -1 		browser.xi.openAttachment(id, event.target.href);
   41    -1 	}
   42    -1 });
   43    -1 
   44    -1 document.addEventListener('click', function(event) {
   45    -1 	if (event.target.matches('a.attachment-save')) {
   46    -1 		event.preventDefault();
   47    -1 		var id = parseInt(event.target.closest('[id^="msg-"]').id.substr(4), 10);
   48    -1 		browser.xi.saveAttachment(id, event.target.href);
   49    -1 	}
   50    -1 });