Skip to content
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.

Commit

Permalink
Support optional CN
Browse files Browse the repository at this point in the history
Now supporting CN for a human-readable attendee name. Defaults to the
attendee’s email address.
  • Loading branch information
james-emerton committed Oct 5, 2014
1 parent ef006fd commit aeba408
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/event.js
Expand Up @@ -114,16 +114,18 @@ VEvent.prototype.inTimeRange = function(start, end) {
//
// fromuser: URL for the user, usually in the form mailto:bob@example.com
// status: true, false, 'ACCEPTED', 'DECLINED', 'TENTATIVE', or as per RFC5545
VEvent.prototype.reply = function(fromuser, status) {
VEvent.prototype.reply = function(fromuser, status, options) {
var resp = this.clone(true);
options = options || {};

if(status === true || status === undefined)
status = 'ACCEPTED';
else if(status === false)
status = 'DECLINED';

resp.setProperty('ATTENDEE', fromuser, {
'PARTSTAT': status
'PARTSTAT': status,
'CN': options['CN'] || fromuser
});

resp.setProperty('DTSTAMP', new Date());
Expand Down

0 comments on commit aeba408

Please sign in to comment.