[gozerbot] push by bthate - over to test on 2012-08-05 14:17 GMT

0 views
Skip to first unread message

goze...@googlecode.com

unread,
Aug 5, 2012, 10:17:21 AM8/5/12
to gozerbo...@googlegroups.com
Revision: 71476f11d0eb
Author: Bart Thate <bth...@gmail.com>
Date: Sun Aug 5 07:17:01 2012
Log: over to test
http://code.google.com/p/gozerbot/source/detail?r=71476f11d0eb

Modified:
/gozerbot/xmpp/bot.py
/gozerbot/xmpp/core.py

=======================================
--- /gozerbot/xmpp/bot.py Sun Aug 5 06:29:18 2012
+++ /gozerbot/xmpp/bot.py Sun Aug 5 07:17:01 2012
@@ -529,7 +529,8 @@
self.errorwait.register("409", q, 3)
self.errorwait.register("401", q, 3)
self.errorwait.register("400", q, 3)
- presence = Presence({'to': channel + '/' + nick}, self)
+ presence = Presence({'to': channel + '/' +
nick, "xmlns": 'http://jabber.org/protocol/muc' }, self)
+ #presence = Presence({'to': channel + '/' + nick}, self)
if password: presence.x['password'] = password
self.send(presence)
errorobj = waitforqueue(q, 3)
=======================================
--- /gozerbot/xmpp/core.py Sun Aug 5 06:49:19 2012
+++ /gozerbot/xmpp/core.py Sun Aug 5 07:17:01 2012
@@ -21,13 +21,14 @@
from namespace import attributes, subelements

## basic imports
-import xml.parsers.expat
+import xml.parsers.expat
import socket
import os
import time
import copy
import logging
import thread
+import types

## locks

@@ -86,7 +87,18 @@
try:
data = res[subelement]
if data:
- main += "<%s>%s</%s>" % (subelement,
XMLescape(str(data)), subelement)
+ if subelement == "x" and res.has_key("xmlns"): main
+= '<x xmlns="%s">' % res["xmlns"]
+ else: main += "<%s>" % subelement
+ if type(data) == types.DictType:
+ for s in data:
+ try:
+ d = data[s]
+ if d:
+ main += "<%s>%s</%s>" % (s,
XMLescape(d), s)
+ except KeyError: pass
+ else: main += XMLescape(data)
+ main += "</%s>" % subelement
+ #main += "<%s>%s</%s>" % (subelement,
XMLescape(str(data)), subelement)
gotsub = True
except KeyError: pass
if gotsub: main += "</%s>" % elem
Reply all
Reply to author
Forward
0 new messages