Subject: GTalk Bot Auto Unsubscribe Problem
Hi,
I am developing a GTALK bot in vb.net and have got it auto subscribing and responding to commands, however I cannot get it to auto UNsubscribe.
I check the incomming chat for a keyword to unsubscribe the user. I then issue the command xmpp.PresenceManager.RefuseSubscriptionRequest(msg.from) however GTalk is returning the following error
<presence xmlns="jabber:client" type="error" to="xxx@gmail.com/JonJab2F3C2F99" from="xxx@gmail.com/Talk.v722F1ADDBF"><error code="400" type="modify"><jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Must subscribe to bare JID</text></error></presence>
I have tried to use the .bare however this returns a string and I am receiveing a .net error saying that a string cannot be converted to agsXMPP.Jid
Here is a code snippet of the code I am using
Do you know of a way of returning the bare jid as a jid
I have even tried cType(msg.From.bare,agsXMPP.Jid) but again this to fails.
Many Thanks in Advance.
I am developing a GTALK bot in vb.net and have got it auto subscribing and responding to commands, however I cannot get it to auto UNsubscribe.
I check the incomming chat for a keyword to unsubscribe the user. I then issue the command xmpp.PresenceManager.RefuseSubscriptionRequest(msg.from) however GTalk is returning the following error
<presence xmlns="jabber:client" type="error" to="xxx@gmail.com/JonJab2F3C2F99" from="xxx@gmail.com/Talk.v722F1ADDBF"><error code="400" type="modify"><jid-malformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Must subscribe to bare JID</text></error></presence>
I have tried to use the .bare however this returns a string and I am receiveing a .net error saying that a string cannot be converted to agsXMPP.Jid
Here is a code snippet of the code I am using
Private Sub xmpp_OnMessage(ByVal sender As Object, ByVal msg As
agsxmpp.protocol.client.Message)
If msg.Body.StartsWith("9") Then
xmpp.PresenceManager.RefuseSubscriptionRequest(msg.From)
End If
End Sub
If I add .bare to msg.from I get the .net error regarding conversion.agsxmpp.protocol.client.Message)
If msg.Body.StartsWith("9") Then
xmpp.PresenceManager.RefuseSubscriptionRequest(msg.From)
End If
End Sub
Do you know of a way of returning the bare jid as a jid
I have even tried cType(msg.From.bare,agsXMPP.Jid) but again this to fails.
Many Thanks in Advance.