My favorites
▼
|
Sign in
pyicqt
ICQ transport for XMPP
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
123
attachment: pyicq-xep0203.patch
(4.0 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Send offline messages with XEP-0091 and not with time in message.
#
# Author: Pavol "Scrool" Babincak <scroolik-NO-SPAM-at-gmail.com>
# Version: 0.1
# Date: 2007-05-17
#
diff -u -r pyicq-t/src/globals.py pyicq-t-xep0091/src/globals.py
--- pyicq-t/src/globals.py 2007-05-17 04:39:26.000000000 +0200
+++ pyicq-t-xep0091/src/globals.py 2007-05-17 04:44:12.000000000 +0200
@@ -37,6 +37,7 @@
XAVATAR = "jabber:x:avatar"
XCONFERENCE = "jabber:x:conference"
XDATA = "jabber:x:data"
+XDELAY = "jabber:x:delay"
XEVENT = "jabber:x:event"
XHTML = "http://jabber.org/protocol/xhtml-im"
SAPO_NOERROR = "sapo:noerror"
diff -u -r pyicq-t/src/jabw.py pyicq-t-xep0091/src/jabw.py
--- pyicq-t/src/jabw.py 2007-05-17 04:39:22.000000000 +0200
+++ pyicq-t-xep0091/src/jabw.py 2007-05-17 04:44:56.000000000 +0200
@@ -22,7 +22,7 @@
if delay:
x = el.addElement("x")
- x.attributes["xmlns"] = globals.IQDELAY
+ x.attributes["xmlns"] = globals.XDELAY
x.attributes["from"] = fro
x.attributes["stamp"] = delay
diff -u -r pyicq-t/src/legacy/icqt.py pyicq-t-xep0091/src/legacy/icqt.py
--- pyicq-t/src/legacy/icqt.py 2007-05-17 04:39:19.000000000 +0200
+++ pyicq-t-xep0091/src/legacy/icqt.py 2007-05-17 04:45:04.000000000 +0200
@@ -201,7 +201,7 @@
c.updatePresence(show=show, status=status, ptype=ptype)
self.oscarcon.legacyList.updateSSIContact(user.name, presence=ptype, show=show, status=status)
- def receiveMessage(self, user, multiparts, flags):
+ def receiveMessage(self, user, multiparts, flags, delay=None):
from glue import icq2jid
LogEvent(INFO, self.session.jabberID, "%s %s %s" % (user.name, multiparts, flags))
@@ -224,7 +224,7 @@
if "auto" in flags:
mtype = "headline"
- self.session.sendMessage(to=self.session.jabberID, fro=sourcejid, body=text, mtype=mtype, xhtml=xhtml)
+ self.session.sendMessage(to=self.session.jabberID, fro=sourcejid, body=text, mtype=mtype, delay=delay, xhtml=xhtml)
self.session.pytrans.serviceplugins['Statistics'].stats['IncomingMessages'] += 1
self.session.pytrans.serviceplugins['Statistics'].sessionUpdate(self.session.jabberID, 'IncomingMessages', 1)
if not config.disableAwayMessage and self.awayMessage and not "auto" in flags:
diff -u -r pyicq-t/src/tlib/oscar.py pyicq-t-xep0091/src/tlib/oscar.py
--- pyicq-t/src/tlib/oscar.py 2007-05-17 04:39:14.000000000 +0200
+++ pyicq-t-xep0091/src/tlib/oscar.py 2007-05-17 04:49:49.000000000 +0200
@@ -1622,12 +1622,12 @@
# Offline message
senderuin = struct.unpack('<I',v[10:14])[0]
#print "senderuin: "+str(senderuin)+"\n"
- msg_date = str( "%4d-%02d-%02d %02d:%02d"
- % struct.unpack('<HBBBB', v[14:20]) )
+ msg_date = str( "%4d-%02d-%02dT%02d:%02d:00Z" #XEP-0203 and XEP-0082 date format
+ % struct.unpack('<HBBBB', v[14:20]) )
messagetype, messageflags,messagelen = struct.unpack('<BBH',v[20:24])
umessage, encoding = guess_encoding(v[24:24+messagelen-1],self.defaultEncoding)
log.msg("Converted message, encoding %r: %r" % (encoding, umessage))
- umessage = umessage + "\n\n/sent " + msg_date
+ #umessage = umessage + "\n\n/sent " + msg_date
message = [ umessage.encode("utf-16be"), "unicode" ]
#message = [ str( v[24:24+messagelen-1] )
# + "\n\n/sent " + msg_date ]
@@ -1638,7 +1638,7 @@
tlvs = dict()
multiparts.append(tuple(message))
user = OSCARUser(str(senderuin), None, tlvs)
- self.receiveMessage(user, multiparts, flags)
+ self.receiveMessage(user, multiparts, flags, msg_date)
elif (type == 0x42):
# End of offline messages
reqdata = '\x08\x00'+struct.pack("<I",int(self.username))+'\x3e\x00\x02\x00'
Powered by
Google Project Hosting