summaryrefslogtreecommitdiff
path: root/sunshine/lqsoft/pygadu/network_v8.py
diff options
context:
space:
mode:
Diffstat (limited to 'sunshine/lqsoft/pygadu/network_v8.py')
-rwxr-xr-xsunshine/lqsoft/pygadu/network_v8.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/sunshine/lqsoft/pygadu/network_v8.py b/sunshine/lqsoft/pygadu/network_v8.py
index e96bcb1..1d5db79 100755
--- a/sunshine/lqsoft/pygadu/network_v8.py
+++ b/sunshine/lqsoft/pygadu/network_v8.py
@@ -105,7 +105,7 @@ class LoginPacket(GaduPacket):
login_hash = StringField(3, length=64)
status = UIntField(4, default=0x02)
flags = UIntField(5, default=0x03)
- features = UIntField(6, default=0x2637)
+ features = UIntField(6, default=0x2777)
local_ip = IntField(7)
local_port = ShortField(8)
external_ip = IntField(9)
@@ -123,12 +123,14 @@ class LoginPacket(GaduPacket):
self.login_hash = hash.digest()
LoginPacket = outpacket(0x31)(LoginPacket)
-#@inpacket(0x35)
+class Login80FailedPacket(GaduPacket):
+ reserved = IntField(0, True)
+Login80FailedPacket = inpacket(0x43)(Login80FailedPacket)
+
class LoginOKPacket(GaduPacket): #LoginOk80
reserved = IntField(0, True)
LoginOKPacket = inpacket(0x35)(LoginOKPacket)
-#@inpacket(0x2e)
class MessageInPacket(GaduPacket): #RecvMsg80
sender = IntField(0)
seq = IntField(1)
@@ -136,14 +138,12 @@ class MessageInPacket(GaduPacket): #RecvMsg80
content = StructField(3, struct=StructMessage)
MessageInPacket = inpacket(0x2e)(MessageInPacket)
-#@outpacket(0x2d)
class MessageOutPacket(GaduPacket):
recipient = IntField(0, default=None)
seq = IntField(1)
content = StructField(2, struct=StructMessage)
MessageOutPacket = outpacket(0x2d)(MessageOutPacket)
-#@outpacket(0x38)
class ChangeStatusPacket(GaduPacket): #NewStatus80
STATUS = Enum({
'NOT_AVAILABLE': 0x0001,
@@ -172,12 +172,10 @@ class ChangeStatusPacket(GaduPacket): #NewStatus80
description = StringField(3, length='description_size')
ChangeStatusPacket = outpacket(0x38)(ChangeStatusPacket)
-#@inpacket(0x36)
class StatusUpdatePacket(GaduPacket): # Status80
contact = StructField(0, struct=StructStatus)
StatusUpdatePacket = inpacket(0x36)(StatusUpdatePacket)
-#@inpacket(0x37)
class StatusNoticiesPacket(GaduPacket): # NotifyReply80
contacts = ArrayField(0, length=-1, subfield=StructField(0, struct=StructStatus))
StatusNoticiesPacket = inpacket(0x37)(StatusNoticiesPacket)
@@ -185,7 +183,6 @@ StatusNoticiesPacket = inpacket(0x37)(StatusNoticiesPacket)
#
# Contact database altering packets
#
-#@outpacket(0x2f)
class ULRequestPacket(GaduPacket): # UserListReq80
"""Import contact list from the server"""
TYPE = Enum({
@@ -198,7 +195,6 @@ class ULRequestPacket(GaduPacket): # UserListReq80
data = StringField(1, length=-1)
ULRequestPacket = outpacket(0x2f)(ULRequestPacket)
-#@inpacket(0x30)
class ULReplyPacket(GaduPacket): # UserListReply80
TYPE = Enum({
'PUT_REPLY': 0x00,
@@ -222,17 +218,14 @@ ULReplyPacket = inpacket(0x30)(ULReplyPacket)
#
# GG_XML_EVENT and GG_XML_ACTION packets
#
-#@inpacket(0x27)
class XmlEventPacket(GaduPacket):
data = StringField(0, length=-1)
XmlEventPacket = inpacket(0x27)(XmlEventPacket)
-#@inpacket(0x2c)
class XmlActionPacket(GaduPacket):
data = StringField(0, length=-1)
XmlActionPacket = inpacket(0x2c)(XmlActionPacket)
-#@outpacket(0x46)
class RecvMsgAck(GaduPacket):
num = IntField(0)
RecvMsgAck = outpacket(0x46)(RecvMsgAck)
@@ -240,7 +233,6 @@ RecvMsgAck = outpacket(0x46)(RecvMsgAck)
#
# GG_USER_DATA packets
#
-#@inpacket(0x44)
class UserDataPacket(GaduPacket):
type = IntField(0)
num = IntField(1)
@@ -250,8 +242,6 @@ UserDataPacket = inpacket(0x44)(UserDataPacket)
#
# GG_TYPING_NOTIFY packets
#
-#@inpacket(0x59)
-#@outpacket(0x59)
class TypingNotifyPacket(GaduPacket):
TYPE = Enum({
'START': 0x01,
@@ -261,4 +251,4 @@ class TypingNotifyPacket(GaduPacket):
type = ShortField(0)
uin = IntField(1)
TypingNotifyPacket = inpacket(0x59)(TypingNotifyPacket)
-TypingNotifyPacket = outpacket(0x59)(TypingNotifyPacket) \ No newline at end of file
+TypingNotifyPacket = outpacket(0x59)(TypingNotifyPacket)