diff --git a/scenes/Connections.gd b/scenes/Connections.gd index 7c29592..93b3326 100644 --- a/scenes/Connections.gd +++ b/scenes/Connections.gd @@ -6,15 +6,13 @@ class Connection extends Reference: var domain: String var bare_jid: String var jid: String - var id_counter: int = 0 + var _id_counter: int = 0 func generate_id() -> int: - self.id_counter += 1 - return hash(self.id_counter) + self._id_counter += 1 + return hash(self._id_counter) func establish_new_connection(domain: String, identity: String, password: String) -> Connection: - ## XMPP uses unidirectional pipes for communication, which means - ## multiple connections are open over different predefined ports. var stream := StreamPeerTCP.new() if stream.connect_to_host(domain, 5222) != OK: push_error("Cannot establish client->server pipe to " + domain) @@ -245,7 +243,7 @@ func _bind_resource(connection: Connection, resource: String = "tochie-facade") {resource} """.format({ "id": iq_id, - "resource": resource + "resource": resource.xml_escape() }).to_utf8()) != OK: return ERR_CONNECTION_ERROR