protected override bool InternalExecute() { InstantMessageProvider provider = base.Provider; StoreId storeId = null; if (provider == null) { ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "instant message provider is null"); return(false); } using (Folder folder = Folder.Bind(base.MailboxIdentityMailboxSession, DefaultFolderType.QuickContacts)) { ExTraceGlobals.InstantMessagingTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Removing instant message buddy:{0},{1}", this.instantMessageBuddy.DisplayName, this.instantMessageBuddy.SipUri); ComparisonFilter queryFilter = new ComparisonFilter(ComparisonOperator.Equal, ContactSchema.PersonId, this.personId); using (QueryResult queryResult = folder.ItemQuery(ItemQueryType.None, queryFilter, null, RemoveBuddy.contactProperties)) { IStorePropertyBag[] propertyBags = queryResult.GetPropertyBags(1); if (propertyBags == null || propertyBags.Length == 0) { ExTraceGlobals.InstantMessagingTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Lync contact cannot be found in store: {0},{1}", this.instantMessageBuddy.DisplayName, this.instantMessageBuddy.SipUri); return(false); } storeId = propertyBags[0].GetValueOrDefault <VersionedId>(ItemSchema.Id, null).ObjectId; } } ExTraceGlobals.InstantMessagingTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Removing instant message buddy after retrieving store id of the contact:{0},{1}", this.instantMessageBuddy.DisplayName, storeId.ToBase64String()); provider.RemoveBuddy(base.MailboxIdentityMailboxSession, this.instantMessageBuddy, storeId); return(true); }
protected override bool InternalExecute() { InstantMessageProvider provider = base.Provider; if (provider != null) { provider.AddBuddy(base.MailboxIdentityMailboxSession, this.instantMessageBuddy, this.instantMessageGroup); return(true); } return(false); }
protected override bool InternalExecute() { InstantMessageProvider provider = base.Provider; if (provider != null) { provider.DeclineBuddy(this.instantMessageBuddy); return(true); } return(false); }