-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from nextcloud/feature/11-12/inbox_outbox
Add support for RFC6638 and RFC7953
- Loading branch information
Showing
9 changed files
with
339 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* CDAV Library | ||
* | ||
* This library is part of the Nextcloud project | ||
* | ||
* @author Georg Ehrke | ||
* @copyright 2019 Georg Ehrke <oc.list@georgehrke.com> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
import * as NS from '../utility/namespaceUtility.js'; | ||
|
||
/** | ||
* This function is capable of creating the propset xml structure for: | ||
* - {urn:ietf:params:xml:ns:caldav}calendar-availability | ||
* | ||
* @param {Object} props | ||
* @return {Object} | ||
*/ | ||
export default function calendarPropSet(props) { | ||
const xmlified = []; | ||
|
||
Object.entries(props).forEach(([key, value]) => { | ||
switch (key) { | ||
case '{urn:ietf:params:xml:ns:caldav}calendar-availability': | ||
xmlified.push({ | ||
name: [NS.IETF_CALDAV, 'calendar-availability'], | ||
value: value.toString() | ||
}); | ||
break; | ||
} | ||
}); | ||
|
||
return xmlified; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* CDAV Library | ||
* | ||
* This library is part of the Nextcloud project | ||
* | ||
* @author Georg Ehrke | ||
* @copyright 2018 Georg Ehrke <oc.list@georgehrke.com> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
import scheduleInboxPropSet from "../../../src/propset/scheduleInboxPropSet.js"; | ||
|
||
describe('Schedule Inbox collection prop-set', () => { | ||
it('should ignore unknown properties', () => { | ||
expect(scheduleInboxPropSet({ | ||
'{Foo:}bar': 123 | ||
})).toEqual([]); | ||
}); | ||
|
||
it('should serialize {DAV:}displayname correctly', () => { | ||
expect(scheduleInboxPropSet({ | ||
'{Foo:}bar': 123, | ||
'{urn:ietf:params:xml:ns:caldav}calendar-availability': 'NEW:VAVAILABILITY' | ||
})).toEqual([ | ||
{ | ||
name: ['urn:ietf:params:xml:ns:caldav', 'calendar-availability'], | ||
value: 'NEW:VAVAILABILITY' | ||
} | ||
]); | ||
}); | ||
}); |