Exemple #1
0
 // Token: 0x06000B00 RID: 2816 RVA: 0x0004DD8E File Offset: 0x0004BF8E
 internal static void GenerateMessageNotDeliveredPayload(InstantMessagePayload payload, string chatId, bool serverPolicy)
 {
     if (serverPolicy)
     {
         InstantMessagePayloadUtilities.GenerateInstantMessageAlertPayload(payload, chatId, InstantMessageAlert.FailedDeliveryDueToServerPolicy);
         return;
     }
     InstantMessagePayloadUtilities.GenerateInstantMessageAlertPayload(payload, chatId, InstantMessageAlert.FailedDelivery);
 }
Exemple #2
0
        // Token: 0x06000AFF RID: 2815 RVA: 0x0004DD44 File Offset: 0x0004BF44
        internal static void GenerateMessageNotDeliveredPayload(InstantMessagePayload payload, string methodName, int conversationId, Exception exception)
        {
            string arg = string.Empty;

            if (exception != null && exception.Message != null)
            {
                arg = exception.Message;
            }
            ExTraceGlobals.InstantMessagingTracer.TraceError <string, string>(0L, "{0} failed. {1}", methodName, arg);
            InstantMessagePayloadUtilities.GenerateMessageNotDeliveredPayload(payload, conversationId.ToString(CultureInfo.InvariantCulture));
        }
Exemple #3
0
        public void SignOut()
        {
            ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageManager.SignOut.");
            InstantMessageProvider instantMessageProvider = Interlocked.Exchange <InstantMessageProvider>(ref this.provider, null);

            if (instantMessageProvider != null)
            {
                if (this.payload != null)
                {
                    InstantMessagePayloadUtilities.GenerateUnavailablePayload(this.payload, null, "Signed out manually.", InstantMessageFailure.ClientSignOut, false);
                }
                instantMessageProvider.Dispose();
            }
        }
Exemple #4
0
        public void TerminateProvider(string reason)
        {
            ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageManager.TerminateProvider.");
            InstantMessageProvider instantMessageProvider = Interlocked.Exchange <InstantMessageProvider>(ref this.provider, null);

            if (instantMessageProvider != null)
            {
                if (this.payload != null)
                {
                    InstantMessagePayloadUtilities.GenerateUnavailablePayload(this.payload, null, "Disconnected from IM by server due to timeout: " + reason, InstantMessageFailure.ServerTimeout, false);
                }
                instantMessageProvider.Dispose();
            }
        }
        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 #6
0
 public void StartProvider()
 {
     ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageManager.StartProvider.");
     if (this.userContext.IsSignedOutOfIM())
     {
         if (this.payload != null)
         {
             InstantMessagePayloadUtilities.GenerateUnavailablePayload(this.payload, null, "Not signed in because IsSignedOutOfIM was true.", InstantMessageFailure.ClientSignOut, false);
         }
     }
     else if ((this.provider == null || this.provider.IsDisposed) && this.userContext.InstantMessagingType == InstantMessagingTypeOptions.Ocs)
     {
         this.StartOcsProvider();
     }
     if (this.provider != null)
     {
         this.Provider.EstablishSession();
     }
 }
Exemple #7
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);
            }
        }
        public void AddMessage(string contentType, string message)
        {
            ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageQueue.AddMessage");
            Interlocked.CompareExchange <List <InstantMessageChat> >(ref this.messageList, new List <InstantMessageChat>(), null);
            bool flag = false;

            lock (this.lockObject)
            {
                if (this.messageList.Count < 20)
                {
                    this.messageList.Add(new InstantMessageChat("text/plain;charset=utf-8", message));
                }
                else
                {
                    flag = true;
                }
            }
            if (flag)
            {
                ExTraceGlobals.InstantMessagingTracer.TraceError <int>((long)this.GetHashCode(), "InstantMessageQueue.AddMessage. Message queued count: {0}", this.messageList.Count);
                InstantMessagePayloadUtilities.GenerateMessageNotDeliveredPayload(this.payload, this.conversation.Cid.ToString(CultureInfo.InvariantCulture));
            }
        }
Exemple #9
0
 // Token: 0x06000AFD RID: 2813 RVA: 0x0004DC94 File Offset: 0x0004BE94
 internal static void GenerateMessageNotDeliveredPayload(InstantMessagePayload payload, string chatId)
 {
     InstantMessagePayloadUtilities.GenerateMessageNotDeliveredPayload(payload, chatId, false);
 }
Exemple #10
0
 // Token: 0x06000AFB RID: 2811 RVA: 0x0004DB30 File Offset: 0x0004BD30
 internal static void GenerateUnavailablePayload(InstantMessagePayload payload, Exception exception, string errorLocation, InstantMessageFailure errorCode, bool recurseThroughException)
 {
     InstantMessagePayloadUtilities.GenerateUnavailablePayload(payload, exception, errorLocation, errorCode, 0, recurseThroughException);
 }
Exemple #11
0
 // Token: 0x06000B01 RID: 2817 RVA: 0x0004DDA6 File Offset: 0x0004BFA6
 internal static void GenerateInstantMessageAlertPayload(InstantMessagePayload payload, string chatId, InstantMessageAlert alertType)
 {
     InstantMessagePayloadUtilities.GenerateInstantMessageAlertPayload(payload, chatId, alertType, null);
 }