Пример #1
0
        public FrmGroupChat(XmppClient xmppClient, Jid roomJid, string nickname, ListView listContract)
        {
            InitializeComponent();
            local_history = new HistoryTransactionTableAdapter();
            connection    = new SqlCeConnection(local_history.Connection.ConnectionString);
            _roomJid      = roomJid;
            _xmppClient   = xmppClient;
            _nickname     = nickname;
            _listContract = listContract;
            fm.XmppClient = FrmLogin.Instance.xmppClient;
            fm.OnFile    += fm_OnFile;
            Text          = roomJid.User + " Group";;
            mm            = new MucManager(xmppClient);

            // Setup new Message Callback using the MessageFilter
            _xmppClient.MessageFilter.Add(roomJid, new BareJidComparer(), MessageCallback);

            // Setup new Presence Callback using the PresenceFilter
            _xmppClient.PresenceFilter.Add(roomJid, new BareJidComparer(), PresenceCallback);

            GetLastRow(_xmppClient.Username, _xmppClient.XmppDomain, _roomJid.Bare, out LastDtDB);
            btnHistory.Enabled = false;
            Form.CheckForIllegalCrossThreadCalls = false;
            Instance = this;
        }
Пример #2
0
        public FrmGroupChat(XmppClient xmppClient, Jid roomJid, string nickname, ListView listContract)
        {
            InitializeComponent();
            local_history = new HistoryTransactionTableAdapter();
            connection = new SqlCeConnection(local_history.Connection.ConnectionString);
            _roomJid = roomJid;
            _xmppClient = xmppClient;
            _nickname = nickname;
            _listContract = listContract;
            fm.XmppClient = FrmLogin.Instance.xmppClient;
            fm.OnFile += fm_OnFile;
            Text = roomJid.User + " Group"; ;
            mm = new MucManager(xmppClient);

            // Setup new Message Callback using the MessageFilter
            _xmppClient.MessageFilter.Add(roomJid, new BareJidComparer(), MessageCallback);

            // Setup new Presence Callback using the PresenceFilter
            _xmppClient.PresenceFilter.Add(roomJid, new BareJidComparer(), PresenceCallback);

            GetLastRow(_xmppClient.Username, _xmppClient.XmppDomain, _roomJid.Bare, out LastDtDB);
            btnHistory.Enabled = false;
            Form.CheckForIllegalCrossThreadCalls = false;
            Instance = this;
        }
Пример #3
0
        private void VcardResponse(object sender, IqEventArgs e)
        {
            if (e.Iq.Type == Matrix.Xmpp.IqType.Result)
            {
                var vc = e.Iq.Query as Vcard;
                UserName = vc.Fullname;

                if (!Util.ChatForms.ContainsKey(Group.Name))
                {
                    var roomJid = new Jid(Group.Name);
                    var f       = new FrmGroupChat(xmppClient, roomJid, UserName, listContacts);
                    f.MdiParent = FrmParent.Instance;
                    f.Show();
                }
            }
        }
Пример #4
0
        private void tsmiEnterRoom_Click(object sender, System.EventArgs e)
        {
            var input = new FrmInputBox("Enter your Nickname for the chatroom", "Nickname", "Nickname");

            if (input.ShowDialog() == DialogResult.OK)
            {
                string nickname = input.Result;
                input = new FrmInputBox("Enter the Jid of the room to join (e.g. [email protected])", "Room");
                if (input.ShowDialog() == DialogResult.OK)
                {
                    var roomJid = new Jid(input.Result);
                    var f       = new FrmGroupChat(xmppClient, roomJid, nickname, listContacts);
                    f.MdiParent = FrmParent.Instance;
                    f.Show();
                }
            }
        }
Пример #5
0
        private void VcardResponse(object sender, IqEventArgs e)
        {
            if (e.Iq.Type == Matrix.Xmpp.IqType.Result)
            {
                var vc = e.Iq.Query as Vcard;
                UserName = vc.Fullname;

                if (!Util.ChatForms.ContainsKey(Group.Name))
                {
                    var roomJid = new Jid(Group.Name);
                    var f = new FrmGroupChat(xmppClient, roomJid, UserName, listContacts);
                    f.MdiParent = FrmParent.Instance;
                    f.Show();
                }
            }
        }
Пример #6
0
 private void tsmiEnterRoom_Click(object sender, System.EventArgs e)
 {
     var input = new FrmInputBox("Enter your Nickname for the chatroom", "Nickname", "Nickname");
     if (input.ShowDialog() == DialogResult.OK)
     {
         string nickname = input.Result;
         input = new FrmInputBox("Enter the Jid of the room to join (e.g. [email protected])", "Room");
         if (input.ShowDialog() == DialogResult.OK)
         {
             var roomJid = new Jid(input.Result);
             var f = new FrmGroupChat(xmppClient, roomJid, nickname, listContacts);
             f.MdiParent = FrmParent.Instance;
             f.Show();
         }
     }
 }