private void PresenceManager_OnSubscribe(object sender, Matrix.Xmpp.Client.PresenceEventArgs e) { if (this.OnSubscribeRequest != null) { this.OnSubscribeRequest(this, new SubscribeRequestEventArgs(e.Presence.From, e.Presence.Status)); } }
void XmppClient_OnBeforeSendPresence(object sender, Matrix.Xmpp.Client.PresenceEventArgs e) { Log.Debug("XmppClient_OnBeforeSendPresence"); /* * this.discoManager = new DiscoManager(this.xmppClient); * this.discoManager.AutoSendCaps = true; * this.discoManager.AutoDiscover = true; * this.discoManager.AutoReplyToDiscoInfo = true; * this.discoManager.AddIdentity(new Matrix.Xmpp.Disco.Identity("pc", "legion-0.1", "client")); * this.discoManager.AddFeature("urn:ietf:rfc:3264"); * this.discoManager.AddFeature("urn:xmpp:jingle:apps:dtls:0"); * this.discoManager.AddFeature("urn:xmpp:jingle:transports:ice-udp:1"); * this.discoManager.AddFeature("urn:xmpp:jingle:apps:rtp:audio"); * this.discoManager.AddFeature("urn:xmpp:jingle:apps:rtp:video"); * this.discoManager.AddFeature("http://jabber.org/protocol/caps"); * this.discoManager.AddFeature("http://jabber.org/protocol/disco#info"); * this.discoManager.AddFeature("urn:xmpp:openpgp:im:0"); */ // These could be used to find out server items / capabilities. not interesting for now. we check elsewhere for individual clients. // this.discoManager.DiscoverItems(this.xmppClient.XmppDomain, new System.EventHandler<Matrix.Xmpp.Client.IqEventArgs>(DiscoItemsResult)); //this.discoManager.DiscoverInformation(this.xmppClient.XmppDomain); }
void XmppClient_OnPresence(object sender, Matrix.Xmpp.Client.PresenceEventArgs e) { // when we see that someone is online then we see initiate discovery of capabilities if (e.Presence.Type != PresenceType.Unavailable) { // test if we have a key already // this.pubsubManager.RequestAllItems(_pubsubServer, "urn:xmpp:openpgp:0", new EventHandler<IqEventArgs>(DiscoPubSubRequestAllItemsResult)); // this.discoManager.DiscoverInformation(e.Presence.From, new System.EventHandler<Matrix.Xmpp.Client.IqEventArgs>(DiscoInfoResult)); } Log.Info("OnPresence " + e.Presence.From); // also raise event to update contact list if (this.OnPresence != null) { this.OnPresence(this, new PresenceEventArgs(e.Presence.From, e.Presence.Type)); } }
private void PresenceManager_OnSubscribed(object sender, Matrix.Xmpp.Client.PresenceEventArgs e) { Log.Info("OnSubscribed from " + e.Presence.From); // pubsubManager.Subscribe("", "urn:xmpp:openpgp:0", e.Presence.From); }