예제 #1
0
        private IQ ProcessSession(XmppStream stream, IQ iq, XmppHandlerContext context)
        {
            var session = context.SessionManager.GetSession(iq.From);

            if (session == null)
            {
                return(XmppStanzaError.ToItemNotFound(iq));
            }

            var answer = new IQ(IqType.result);

            answer.Id      = iq.Id;
            answer.Session = new Core.protocol.iq.session.Session();
            session.Active = true;
            return(answer);
        }
예제 #2
0
        protected virtual IQ GetDiscoInfo(XmppStream stream, IQ iq, XmppHandlerContext context)
        {
            if (((DiscoInfo)iq.Query).Node != null)
            {
                return(XmppStanzaError.ToServiceUnavailable(iq));
            }

            var service = ServiceManager.GetService(Jid);

            if (service == null)
            {
                return(XmppStanzaError.ToItemNotFound(iq));
            }

            var answer = new IQ(IqType.result);

            answer.Id    = iq.Id;
            answer.From  = Jid;
            answer.To    = iq.From;
            answer.Query = service.DiscoInfo;
            return(answer);
        }