Ejemplo n.º 1
0
        void _OnUserListMenuWhoisActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            IList <PersonModel> persons = GetSelectedPersons();

            if (persons == null)
            {
                return;
            }

            foreach (PersonModel person in persons)
            {
                var per = person;

                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        XmppProtocolManager.CommandWhoIs(
                            new CommandModel(
                                Frontend.FrontendManager,
                                ChatModel,
                                per.ID
                                )
                            );
                    } catch (Exception ex) {
                        Frontend.ShowException(ex);
                    }
                });
            }
        }
Ejemplo n.º 2
0
        void OnPersonRenameEdited(object o, Gtk.EditedArgs e)
        {
            Trace.Call(o, e);

            Gtk.TreeIter iter;
            if (!PersonTreeView.Model.GetIterFromString(out iter, e.Path))
            {
                return;
            }
            PersonModel person = (PersonModel)PersonTreeView.Model.GetValue(iter, 0);

            ThreadPool.QueueUserWorkItem(delegate {
                try {
                    XmppProtocolManager.CommandContact(
                        new CommandModel(
                            Frontend.FrontendManager,
                            ChatModel,
                            "rename " + person.ID + " " + e.NewText
                            )
                        );
                } catch (Exception ex) {
                    Frontend.ShowException(ex);
                }
            });
        }
Ejemplo n.º 3
0
 public InviteToMenu(XmppProtocolManager protocolManager,
                     ChatViewManager chatViewManager,
                     PersonModel invitee) :
     this(protocolManager,
          chatViewManager,
          new [] { invitee })
 {
 }
Ejemplo n.º 4
0
        void _OnMenuAddToContactsItemActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            ThreadPool.QueueUserWorkItem(delegate {
                try {
                    XmppProtocolManager.CommandContact(
                        new CommandModel(
                            Frontend.FrontendManager,
                            ChatModel,
                            "add " + PersonModel.ID
                            )
                        );
                } catch (Exception ex) {
                    Frontend.ShowException(ex);
                }
            });
        }
Ejemplo n.º 5
0
        public InviteToMenu(XmppProtocolManager protocolManager,
                            ChatViewManager chatViewManager,
                            IList <PersonModel> invitees)
        {
            if (protocolManager == null)
            {
                throw new ArgumentNullException("protocolManager");
            }
            if (chatViewManager == null)
            {
                throw new ArgumentNullException("chatViewManager");
            }
            if (invitees == null)
            {
                throw new ArgumentNullException("invitees");
            }

            ProtocolManager = protocolManager;
            ChatViewManager = chatViewManager;
            Invitees        = invitees;
        }
Ejemplo n.º 6
0
        void _OnMenuAddToContactsItemActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            IList <PersonModel> persons = GetSelectedPersons();

            if (persons == null)
            {
                return;
            }

            foreach (PersonModel person in persons)
            {
                var per = person;

                // is this a groupchat contact whose real id is unknown
                if (person.ID.StartsWith(ID))
                {
                    continue;
                }

                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        XmppProtocolManager.CommandContact(
                            new CommandModel(
                                Frontend.FrontendManager,
                                ChatModel,
                                "add " + per.ID
                                )
                            );
                    } catch (Exception ex) {
                        Frontend.ShowException(ex);
                    }
                });
            }
        }