]>
Commit | Line | Data |
---|---|---|
a52fdaed | 1 | diff -ur gajim-0.7-old/src/common/connection.py gajim-0.7/src/common/connection.py |
2 | --- gajim-0.7-old/src/common/connection.py 2005-05-23 20:22:06.000000000 +0200 | |
3 | +++ gajim-0.7/src/common/connection.py 2005-06-03 22:29:02.033694568 +0200 | |
4 | @@ -157,7 +157,10 @@ | |
5 | def _vCardCB(self, con, vc): | |
6 | """Called when we recieve a vCard | |
7 | Parse the vCard and send it to plugins""" | |
8 | - vcard = {'jid': vc.getFrom().getStripped()} | |
9 | + try: | |
10 | + vcard = {'jid': vc.getFrom().getStripped()} | |
11 | + except: | |
12 | + vcard = {} | |
13 | if vc.getTag('vCard').getNamespace() == common.xmpp.NS_VCARD: | |
14 | card = vc.getChildren()[0] | |
15 | for info in card.getChildren(): | |
16 | diff -ur gajim-0.7-old/src/common/xmpp/auth.py gajim-0.7/src/common/xmpp/auth.py | |
17 | --- gajim-0.7-old/src/common/xmpp/auth.py 2005-05-23 20:22:05.000000000 +0200 | |
18 | +++ gajim-0.7/src/common/xmpp/auth.py 2005-06-03 22:29:02.037693960 +0200 | |
19 | @@ -109,7 +109,8 @@ | |
20 | two Dispatcher.Process() calls. """ | |
21 | self.username=username | |
22 | self.password=password | |
23 | - if self._owner.Dispatcher.Stream.features: | |
24 | + if self.startsasl: pass | |
25 | + elif self._owner.Dispatcher.Stream.features: | |
26 | try: self.FeaturesHandler(self._owner.Dispatcher,self._owner.Dispatcher.Stream.features) | |
27 | except NodeProcessed: pass | |
28 | else: self._owner.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS) | |
29 | diff -ur gajim-0.7-old/src/common/xmpp/transports.py gajim-0.7/src/common/xmpp/transports.py | |
30 | --- gajim-0.7-old/src/common/xmpp/transports.py 2005-05-23 20:22:05.000000000 +0200 | |
31 | +++ gajim-0.7/src/common/xmpp/transports.py 2005-06-03 22:29:02.045692744 +0200 | |
32 | @@ -31,6 +31,7 @@ | |
33 | from simplexml import ustr | |
34 | from client import PlugIn | |
35 | from protocol import * | |
36 | +import dns.resolver | |
37 | ||
38 | class error: | |
39 | """An exception to be raised in case of low-level errors in methods of 'transports' module.""" | |
40 | @@ -50,6 +51,29 @@ | |
41 | PlugIn.__init__(self) | |
42 | self.DBG_LINE='socket' | |
43 | self._exported_methods=[self.send,self.disconnect] | |
44 | + | |
45 | + # SRV resolver hacks | |
46 | + host, port = server | |
47 | + possible_queries = [ | |
48 | + "_xmpp-client._tcp." + host, | |
49 | + "_jabber._tcp." + host, | |
50 | + ] | |
51 | + for query in possible_queries: | |
52 | + try: | |
53 | + answers = [x for x in dns.resolver.query (query, "SRV")] | |
54 | + if answers: | |
55 | + host = str (answers[0].target) | |
56 | + port = int (answers[0].port) | |
57 | + if port == 5223 and query[:5] == "_xmpp": | |
58 | + # temporary hack | |
59 | + port = 5222 | |
60 | + break | |
61 | + except: | |
62 | + pass | |
63 | + | |
64 | + server = (host, port) | |
65 | + # end of SRV resolver hacks | |
66 | + | |
67 | self._server = server | |
68 | ||
69 | def plugin(self, owner): |