示例#1
0
        public static void ReceiveNudge(string userID)
        {
            bool       isChatWindowOpen = IsChatWindowOpen(userID);
            ChatWindow foundChatWindow  = GetChatWindow(userID);

            if (foundChatWindow != null)
            {
                foundChatWindow.Nudge();

                if (!foundChatWindow.IsFocused & Personal.USER_INFO.status == Convert.ToInt16(UserStatus.Available))
                {
                    Player.PlaySound(Identifiers.NUDGE);

                    if (!isChatWindowOpen)
                    {
                        string truncatedMessage = "Sent you a nudge!";
                        Notification.NotificationManager.Showpopup(foundChatWindow.GetContactName(), truncatedMessage, foundChatWindow);
                    }
                }

                FlashWindowManager.FlashWindow(foundChatWindow, 5);
            }
        }
示例#2
0
        public static void ReceiveMessage(Message chatMessage)
        {
            bool       isChatWindowOpen = IsChatWindowOpen(chatMessage.id);
            ChatWindow foundChatWindow  = GetChatWindow(chatMessage.id);

            if (foundChatWindow != null)
            {
                foundChatWindow.AddChatMessage(foundChatWindow.GetContactName(), chatMessage.message);

                if (!foundChatWindow.IsFocused & Personal.USER_INFO.status == Convert.ToInt16(UserStatus.Available))
                {
                    Player.PlaySound(Identifiers.NEW_MSG);

                    if (!isChatWindowOpen)
                    {
                        string truncatedMessage = chatMessage.message.Length <= 20 ? chatMessage.message : chatMessage.message.Substring(0, 20) + "...";
                        Notification.NotificationManager.Showpopup(foundChatWindow.GetContactName(), truncatedMessage, foundChatWindow);
                    }
                }

                FlashWindowManager.FlashWindow(foundChatWindow, 5);
            }
        }