@@ -163,6 +163,63 @@ public class Invite {
163163 setRecurId (recurrenceId );
164164 }
165165
166+ Invite (MailItem .Type type , String methodStr , TimeZoneMap tzmap , CalendarItem calItem , String uid , String status ,
167+ String priority , String pctComplete , long completed , String freebusy , String transp , String classProp ,
168+ ParsedDateTime start , ParsedDateTime end , ParsedDuration duration , Recurrence .IRecurrence recurrence ,
169+ boolean isOrganizer , ZOrganizer org , List <ZAttendee > attendees , String name , String operationType , String tagColour ,
170+ String loc , int flags , String partStat , Boolean rsvp , RecurId recurrenceId , long dtstamp , long lastModified ,
171+ int seqno , int lastFullSeqno , int mailboxId , int mailItemId , int componentNum , boolean sentByMe ,
172+ String description , String descHtml , String fragment , List <String > comments , List <String > categories ,
173+ List <String > contacts , Geo geo , String url ) {
174+ setItemType (type );
175+ mMethod = lookupMethod (methodStr );
176+ mTzMap = tzmap ;
177+ mCalItem = calItem ;
178+ mUid = uid ;
179+ mStatus = status ;
180+ mPriority = priority ;
181+ mPercentComplete = pctComplete ;
182+ mCompleted = completed ;
183+ mFreeBusy = freebusy ;
184+ mTransparency = transp ;
185+ mClass = classProp ;
186+ mClassSetByMe = sentByMe ;
187+ mStart = start ;
188+ mEnd = end ;
189+ mDuration = duration ;
190+ mIsOrganizer = isOrganizer ;
191+ mOrganizer = org ;
192+ mAttendees = attendees ;
193+ mName = name != null ? name : "" ;
194+ mOpType = operationType ;
195+ mTagColour = tagColour ;
196+ mLocation = loc != null ? loc : "" ;
197+ mFlags = flags ;
198+ mPartStat = partStat ;
199+ mRsvp = rsvp ;
200+ mSeqNo = seqno ;
201+ // bug 74117 : mLastSeqNo contains the sequence number for which invitation is sent to all the attendees.
202+ // This will be used when accepting the replies.
203+ mLastFullSeqNo = lastFullSeqno ;
204+ setDtStamp (dtstamp );
205+ setLastModified (lastModified );
206+
207+ mMailboxId = mailboxId ;
208+ mMailItemId = mailItemId ;
209+ mComponentNum = componentNum ;
210+ mSentByMe = sentByMe ;
211+ setDescription (description , descHtml );
212+ mFragment = fragment != null ? fragment : "" ;
213+ mComments = comments != null ? comments : new ArrayList <String >();
214+ mCategories = categories != null ? categories : new ArrayList <String >();
215+ mContacts = contacts != null ? contacts : new ArrayList <String >();
216+ mGeo = geo ;
217+ setUrl (url );
218+
219+ setRecurrence (recurrence );
220+ setRecurId (recurrenceId );
221+ }
222+
166223 private Recurrence .IRecurrence mRecurrence ;
167224 public Recurrence .IRecurrence getRecurrence () { return mRecurrence ; }
168225 public void setRecurrence (Recurrence .IRecurrence recur ) {
@@ -278,6 +335,8 @@ public void setInviteId(int invId) {
278335 private static final String FN_LAST_MODIFIED = "lastMod" ;
279336 private static final String FN_METHOD = "mthd" ;
280337 private static final String FN_NAME = "n" ;
338+ private static final String FN_OPERATION_TYPE = "op" ;
339+ private static final String FN_TAG_COLOUR = "tn" ;
281340 private static final String FN_NUM_ATTENDEES = "numAt" ;
282341 private static final String FN_NUM_CATEGORIES = "numCat" ;
283342 private static final String FN_NUM_COMMENTS = "numCmt" ;
@@ -357,6 +416,9 @@ public static Metadata encodeMetadata(Invite inv) {
357416 }
358417
359418 meta .put (FN_NAME , inv .getName ());
419+ meta .put (FN_OPERATION_TYPE , inv .getOperationType ());
420+ meta .put (FN_TAG_COLOUR , inv .getTagColour ());
421+
360422
361423 meta .put (FN_LOCATION , inv .mLocation );
362424 meta .put (FN_APPT_FLAGS , inv .getFlags ());
@@ -579,6 +641,10 @@ public static Invite decodeMetadata(int mailboxId, Metadata meta, CalendarItem c
579641 String name = meta .get (FN_NAME , "" );
580642 String loc = meta .get (FN_LOCATION , null );
581643
644+ // Tag related data
645+ String opType = meta .get (FN_OPERATION_TYPE , null );
646+ String tagCol = meta .get (FN_TAG_COLOUR , null );
647+
582648 // For existing invites with no partstat, default to ACCEPTED status.
583649 String partStat = meta .get (FN_PARTSTAT , IcalXmlStrMap .PARTSTAT_ACCEPTED );
584650 // For existing invites with no RSVP, default to true.
@@ -673,7 +739,7 @@ public static Invite decodeMetadata(int mailboxId, Metadata meta, CalendarItem c
673739
674740 Invite invite = new Invite (type , methodStr , tzMap , calItem , uid , status , priority , pctComplete , completed ,
675741 freebusy , transp , classProp , dtStart , dtEnd , duration , recurrence , isOrganizer , org , attendees , name ,
676- loc , flags , partStat , rsvp , recurrenceId , dtstamp , lastModified ,
742+ opType , tagCol , loc , flags , partStat , rsvp , recurrenceId , dtstamp , lastModified ,
677743 seqno , lastFullSeqno , mailboxId , mailItemId , componentNum , sentByMe ,
678744 desc , descHtml , fragment , comments , categories , contacts , geo , url );
679745 invite .mDescInMeta = descInMeta ; // a little hacky, but necessary
@@ -989,6 +1055,13 @@ public void setIsAllDayEvent(boolean allDayEvent) {
9891055 public void setUid (String uid ) { mUid = uid ; }
9901056 public String getName () { return mName ; };
9911057 public void setName (String name ) { mName = name ; }
1058+
1059+ public String getOperationType () { return mOpType ; };
1060+ public void setOperationType (String op ) { mOpType = op ; }
1061+
1062+ public String getTagColour () { return mTagColour ; };
1063+ public void setTagColour (String tagColour ) { mTagColour = tagColour ; }
1064+
9921065 public String getStatus () { return mStatus ; }
9931066 public void setStatus (String status ) { mStatus = status ; }
9941067 public boolean hasFreeBusy () { return mFreeBusy != null ; }
@@ -1299,6 +1372,10 @@ public String toString() {
12991372 protected long mCompleted = 0 ; // COMPLETED DATE-TIME of VTODO
13001373
13011374 protected String mName ; /* name of the invite, aka "subject" */
1375+
1376+ protected String mOpType ; /* name of the operationType, aka "op" */
1377+ protected String mTagColour ; /* name of the colour, aka "tn" */
1378+
13021379 protected String mLocation ;
13031380 protected int mFlags = APPT_FLAG_EVENT ;
13041381 protected long mDTStamp = 0 ;
0 commit comments