Example #1
0
        private void CreateConversation(object o)
        {
            var message       = TranslationSource.Instance["CreateNewChannelMessage"];
            var confirmBtnMsg = TranslationSource.Instance["ConfirmBtnContent"];
            var denyBtnMsg    = TranslationSource.Instance["DenyBtnContent"];

            var dlg = new ChatGenericDialogBoxVue(message, true, confirmBtnMsg, denyBtnMsg);

            dlg.ShowDialog();
        }
        public void OnConversationInviteReceived(ConversationInviteResponse conversationInviteResponse)
        {
            var message       = string.Format(TranslationSource.Instance["ConversationInvitationMessage"], conversationInviteResponse.User.Username, conversationInviteResponse.ConvName);
            var confirmBtnMsg = TranslationSource.Instance["ConfirmBtnContent"];
            var denyBtnMesg   = TranslationSource.Instance["DenyBtnContent"];

            Application.Current.Dispatcher.BeginInvoke((Action) delegate {
                var dlg = new ChatGenericDialogBoxVue(message, false, confirmBtnMsg, denyBtnMesg);

                if (dlg.ShowDialog() == true)
                {
                    JoinConversartion(conversationInviteResponse.Conversation);
                }
            });
        }
        public void LoadConversationMessages(Conversation conversation)
        {
            App.Current.Dispatcher.BeginInvoke((Action) delegate
            {
                messageUIDS.Clear();
                Messages.Clear();
                conversationFilter = string.Empty;
            });

            if (conversation == null || conversation.UpdateAction == ConversationUpdate.UserRemoved)
            {
                GetUserConversations();
                return;
            }
            if (conversation.UIDS.Contains(AppContextSingleton.Instance.AppContext.CurrentConnectedUser.UID))
            {
                if (!visibilityByConversationID.ContainsKey(conversation.CID))
                {
                    visibilityByConversationID.Add(conversation.CID, false);
                }

                WebSocket.Instance.GetConversationMessages(conversation.CID);
            }
            else
            {
                Application.Current.Dispatcher.BeginInvoke((Action) delegate {
                    var message     = TranslationSource.Instance["JoinConversationMessage"];
                    var joinBtnMsg  = TranslationSource.Instance["JoinChannelDialogJoin"];
                    var denyBtnMesg = TranslationSource.Instance["DenyBtnContent"];

                    //This is not legit, sorry brams
                    if (_joinedConversation.Contains(conversation.CID))
                    {
                        return;
                    }
                    var dlg = new ChatGenericDialogBoxVue(message, false, joinBtnMsg, denyBtnMesg);

                    if (dlg.ShowDialog() == true)
                    {
                        JoinConversartion(conversation);
                    }
                });
            }

            //CurrentConversation = conversation;
            CurrentSelectionChangedEvent.Invoke(CurrentConversation);
        }