Commit c3fdfc3a authored by Yann Leboulanger's avatar Yann Leboulanger

begining of handling jabber:iq:gateway namespace. see #6054

parent 6c829949
......@@ -100,6 +100,7 @@
<property name="visible">True</property>
<property name="no_show_all">True</property>
<property name="model">liststore2</property>
<signal name="changed" handler="on_protocol_jid_combobox_changed"/>
<child>
<object class="GtkCellRendererText" id="cellrenderertext2"/>
<attributes>
......
......@@ -1953,6 +1953,13 @@ class Connection(CommonConnection, ConnectionHandlers):
self.entity_time_ids.append(id_)
self.connection.send(iq)
def request_gateway_prompt(self, jid):
def _on_prompt_result(resp):
gajim.nec.push_incoming_event(GatewayPromptReceivedEvent(None,
conn=self, stanza=resp))
iq = common.xmpp.Iq(typ='get', queryNS=common.xmpp.NS_GATEWAY, to=jid)
self.connection.SendAndCallForResponse(iq, _on_prompt_result)
def get_settings(self):
"""
Get Gajim settings as described in XEP 0049
......
......@@ -1812,3 +1812,14 @@ class FileRequestErrorEvent(nec.NetworkIncomingEvent):
def generate(self):
self.jid = gajim.get_jid_without_resource(self.jid)
return True
class GatewayPromptReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
name = 'gateway-prompt-received'
base_network_events = []
def generate(self):
self.get_jid_resource()
query = self.stanza.getTag('query')
self.desc = query.getTagData('desc')
self.prompt = query.getTagData('prompt')
return True
......@@ -66,6 +66,7 @@ NS_EVENT ='jabber:x:event'
NS_FEATURE ='http://jabber.org/protocol/feature-neg'
NS_FILE ='http://jabber.org/protocol/si/profile/file-transfer' # JEP-0096
NS_GAMING ='http://jabber.org/protocol/gaming' # XEP-0196
NS_GATEWAY ='jabber:iq:gateway' # XEP-0100
NS_GEOLOC ='http://jabber.org/protocol/geoloc' # JEP-0080
NS_GROUPCHAT ='gc-1.0'
NS_HTTP_AUTH ='http://jabber.org/protocol/http-auth' # XEP-0070
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment