core: port parameter is used

This commit is contained in:
Goffi 2012-12-16 18:01:50 +01:00
commit 0dc63402e4

View file

@ -26,7 +26,6 @@ CONST = {
from twisted.application import service
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.words.protocols.jabber import jid, xmlstream
from twisted.words.xish import domish
@ -224,10 +223,16 @@ class SAT(service.Service):
def afterMemoryInit(ignore):
"""This part must be called when we have loaded individual parameters from memory"""
try:
port = int(self.memory.getParamA("Port", "Connection", profile_key = profile))
except ValueError:
error(_("Can't parse port value, using default value"))
port = 5222
current = self.profiles[profile] = xmpp.SatXMPPClient(self, profile,
jid.JID(self.memory.getParamA("JabberID", "Connection", profile_key = profile), profile),
self.memory.getParamA("Password", "Connection", profile_key = profile),
self.memory.getParamA("Server", "Connection", profile_key = profile), 5222)
self.memory.getParamA("Server", "Connection", profile_key = profile),
port)
current.messageProt = xmpp.SatMessageProtocol(self)
current.messageProt.setHandlerParent(current)