public static HashSet <string> GetExpandedGroups(UserContext context)
 {
     if (context.State != UserContextState.Active)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)context.GetHashCode(), "InstantMessageExpandPersistence.GetExpandedGroups: User context is no longer active. Bailing out.");
         return(null);
     }
     try
     {
         context.Lock();
         using (Folder folder = Utilities.SafeFolderBind(context.MailboxSession, DefaultFolderType.Root, new PropertyDefinition[]
         {
             ViewStateProperties.ExpandedGroups
         }))
         {
             if (folder != null)
             {
                 string[] defaultValue = null;
                 string[] array        = Utilities.GetFolderProperty <string[]>(folder, ViewStateProperties.ExpandedGroups, defaultValue);
                 if (array == null)
                 {
                     return(null);
                 }
                 if (array.Length == 1 && array[0] == string.Empty)
                 {
                     array = new string[0];
                 }
                 return(new HashSet <string>(array));
             }
         }
     }
     catch (StoragePermanentException arg)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceError <StoragePermanentException>((long)context.GetHashCode(), "InstantMessageExpandPersistence.GetExpandedGroups. Exception {0}.", arg);
     }
     catch (TransientException arg2)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceError <TransientException>((long)context.GetHashCode(), "InstantMessageExpandPersistence.GetExpandedGroups. Exception {0}.", arg2);
     }
     catch (ThreadAbortException)
     {
     }
     catch (Exception exception)
     {
         InstantMessageUtilities.SendWatsonReport("InstantMessageExpandPersistence.GetExpandedGroups", context, exception);
     }
     finally
     {
         if (context.LockedByCurrentThread())
         {
             context.Unlock();
         }
     }
     return(null);
 }
        private void SendMessageCallback(IAsyncResult result)
        {
            IIMModality iimmodality = null;

            try
            {
                ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageQueue.SendMessageCallback");
                iimmodality = (result.AsyncState as IIMModality);
                if (iimmodality == null)
                {
                    ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageQueue.SendMessageCallback. Instant Messaging Modality is null.");
                }
                else
                {
                    iimmodality.EndSendMessage(result);
                }
            }
            catch (InstantMessagingException ex)
            {
                InstantMessagePayloadUtilities.GenerateMessageNotDeliveredPayload(this.payload, "InstantMessageQueue.SendMessageCallback", (iimmodality == null || iimmodality.Conversation == null) ? 0 : iimmodality.Conversation.Cid, ex);
                InstantMessagingError code = ex.Code;
                if (code <= 18102)
                {
                    if (code == 0)
                    {
                        goto IL_DB;
                    }
                    if (code == 18102)
                    {
                        InstantMessagingErrorSubCode subCode = ex.SubCode;
                        if (subCode != 9)
                        {
                            InstantMessageUtilities.SendWatsonReport("InstantMessageQueue.SendMessageCallback", this.userContext, ex);
                            goto IL_DB;
                        }
                        goto IL_DB;
                    }
                }
                else if (code == 18201 || code == 18204)
                {
                    goto IL_DB;
                }
                InstantMessageUtilities.SendWatsonReport("InstantMessageQueue.SendMessageCallback", this.userContext, ex);
                IL_DB :;
            }
            catch (Exception exception)
            {
                InstantMessageUtilities.SendWatsonReport("InstantMessageQueue.SendMessageCallback", this.userContext, exception);
            }
        }
Exemple #3
0
        // Token: 0x06000B1F RID: 2847 RVA: 0x0004EC98 File Offset: 0x0004CE98
        internal static void SendProxiesToClient(string[] upns, UserContext userContext)
        {
            Dictionary <string, string[]> proxyAddresses = new Dictionary <string, string[]>();

            try
            {
                proxyAddresses = InstantMessageUtilities.GetProxyAddresses(upns, userContext);
            }
            catch (ThreadAbortException)
            {
            }
            catch (Exception exception)
            {
                InstantMessageUtilities.SendWatsonReport("InstantMessageUtilities.GetProxyAddresses", userContext, exception);
            }
            if (userContext != null && userContext.InstantMessageManager != null && userContext.InstantMessageManager.Provider != null && userContext.InstantMessageManager.Provider.Payload != null)
            {
                InstantMessagePayloadUtilities.GenerateProxiesPayload(userContext.InstantMessageManager.Provider.Payload, proxyAddresses);
            }
        }
Exemple #4
0
 private void LogPayloadNotPickedEvent()
 {
     if (!this.overMaxSize)
     {
         this.overMaxSize = true;
         string uriForUser = this.GetUriForUser();
         ExTraceGlobals.InstantMessagingTracer.TraceError <string>((long)this.GetHashCode(), "InstantMessagePayload.LogPayloadNotPickedEvent. Payload has grown too large without being picked up. User: {0}", uriForUser);
         OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_PayloadNotBeingPickedup, string.Empty, new object[]
         {
             this.GetUriForUser()
         });
         PendingRequestManager pendingRequestManager = this.userContext.PendingRequestManager;
         if (pendingRequestManager != null)
         {
             ChunkedHttpResponse chunkedHttpResponse = pendingRequestManager.ChunkedHttpResponse;
             if (chunkedHttpResponse != null && chunkedHttpResponse.IsClientConnected)
             {
                 InstantMessageUtilities.SendWatsonReport("InstantMessagePayload.LogPayloadNotPickedEvent", this.userContext, new OverflowException(string.Format("Payload has grown too large without being picked up. User: {0}", uriForUser)));
             }
         }
         this.Cancel();
         this.payloadString.Append(InstantMessagePayload.overMaxSizeUnavailablePayload);
     }
 }
        private void NotifyDeliverySuccessCallback(IAsyncResult result)
        {
            IIMModality iimmodality = null;

            try
            {
                ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback.");
                iimmodality = (result.AsyncState as IIMModality);
                if (iimmodality == null)
                {
                    ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback. instantMessaging is null.");
                }
                else
                {
                    iimmodality.EndNotifyDeliverySuccess(result);
                }
            }
            catch (InstantMessagingException ex)
            {
                if (!iimmodality.IsConnected)
                {
                    ExTraceGlobals.InstantMessagingTracer.TraceDebug <InstantMessagingException>((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback. Ignoring exception because IM conversation is not connected : {0}.", ex);
                }
                else
                {
                    InstantMessagingError code = ex.Code;
                    switch (code)
                    {
                    case 18102:
                        if (ex.SubCode == 9)
                        {
                            ExTraceGlobals.InstantMessagingTracer.TraceError <InstantMessagingException>((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback. OcsFailureResponse. {0}", ex);
                            goto IL_113;
                        }
                        InstantMessageUtilities.SendWatsonReport("InstantMessageOCSPayload.NotifyDeliverySuccessCallback", this.userContext, ex);
                        goto IL_113;

                    case 18103:
                        break;

                    case 18104:
                        ExTraceGlobals.InstantMessagingTracer.TraceError <InstantMessagingException>((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback. Failed to send delivery success notification. OcsFailureResponse. {0}", ex);
                        goto IL_113;

                    default:
                        if (code == 18201)
                        {
                            ExTraceGlobals.InstantMessagingTracer.TraceError <InstantMessagingException>((long)this.GetHashCode(), "InstantMessageOCSPayload.NotifyDeliverySuccessCallback. OcsFailureResponse. {0}", ex);
                            goto IL_113;
                        }
                        break;
                    }
                    InstantMessageUtilities.SendWatsonReport("InstantMessageOCSPayload.NotifyDeliverySuccessCallback", this.userContext, ex);
                }
                IL_113 :;
            }
            catch (Exception exception)
            {
                InstantMessageUtilities.SendWatsonReport("InstantMessageOCSPayload.NotifyDeliverySuccessCallback", this.userContext, exception);
            }
        }