Esempio n. 1
0
        /// <summary>
        /// Invoked when a message stanza has been received.
        /// </summary>
        /// <param name="stanza">The stanza which has been received.</param>
        /// <returns>true to intercept the stanza or false to pass the stanza
        /// on to the next handler.</returns>
        public bool Input(Sharp.Xmpp.Im.Message message)
        {
            if ((message.Data["result"] != null) &&
                (message.Data["result"].NamespaceURI == "urn:xmpp:mam:1"))
            {
                String queryId  = message.Data["result"].GetAttribute("queryid");
                String resultId = message.Data["result"].GetAttribute("id");

                MessageArchiveRetrieved.Raise(this, new MessageArchiveEventArgs(queryId, resultId, message));
                return(true);
            }

            // Check if we received a message related to "all messages deleted"
            XmlElement deleted = message.Data["deleted", "jabber:iq:notification"];

            if (deleted != null)
            {
                String xmlId = deleted.GetAttribute("id");
                String jid   = deleted.GetAttribute("with");
                if ((xmlId == "all") && (!String.IsNullOrEmpty(jid)))
                {
                    MessagesAllDeleted.Raise(this, new JidEventArgs(jid));
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 2
0
 internal void OnMessagesAllDeleted(object sender, IdEventArgs args)
 {
     MessagesAllDeleted.Raise(sender, args);
 }