This file is indexed.

/usr/lib/thunderbird-addons/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js/calIcsImportExport.js is in xul-ext-lightning 1:24.4.0+build1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://calendar/modules/calUtils.jsm");

/**
 * ICS Import and Export Plugin
 */

// Shared functions
function getIcsFileTypes(aCount) {
    aCount.value = 1;
    return [{
        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIFileType]),
        defaultExtension: 'ics',
        extensionFilter: '*.ics',
        description: cal.calGetString("calendar", 'filterIcs', ['*.ics'])
    }];
}

// Importer
function calIcsImporter() {
    this.wrappedJSObject = this;
}

const calIcsImporterClassID = Components.ID("{1e3e33dc-445a-49de-b2b6-15b2a050bb9d}");
const calIcsImporterInterfaces = [Components.interfaces.calIImporter];
calIcsImporter.prototype = {
    classID: calIcsImporterClassID,
    QueryInterface: XPCOMUtils.generateQI(calIcsImporterInterfaces),
    classInfo: XPCOMUtils.generateCI({
        classID: calIcsImporterClassID,
        contractID: "@mozilla.org/calendar/import;1?type=ics",
        classDescription: "Calendar ICS Importer",
        interfaces: calIcsImporterInterfaces
    }),

    getFileTypes: getIcsFileTypes,

    importFromStream: function importFromStream(aStream, aCount) {
        let parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
                               .createInstance(Components.interfaces.calIIcsParser);
        parser.parseFromStream(aStream, null);
        return parser.getItems(aCount);
    }
};

// Exporter
function calIcsExporter() {
    this.wrappedJSObject = this;
}

const calIcsExporterClassID = Components.ID("{a6a524ce-adff-4a0f-bb7d-d1aaad4adc60}");
const calIcsExporterInterfaces = [Components.interfaces.calIExporter];
calIcsExporter.prototype = {
    classID: calIcsExporterClassID,
    QueryInterface: XPCOMUtils.generateQI(calIcsExporterInterfaces),

    classInfo: XPCOMUtils.generateCI({
        classID: calIcsExporterClassID,
        contractID: "@mozilla.org/calendar/export;1?type=ics",
        classDescription: "Calendar ICS Exporter",
        interfaces: calIcsExporterInterfaces
    }),

    getFileTypes: getIcsFileTypes,

    exportToStream: function exportToStream(aStream, aCount, aItems) {
        let serializer = Components.classes["@mozilla.org/calendar/ics-serializer;1"]
                                   .createInstance(Components.interfaces.calIIcsSerializer);
        serializer.addItems(aItems, aItems.length);
        serializer.serializeToStream(aStream);
    }
};