Ticket #2943 enhancement new
Adding status message (aka available message) support to oscar.py
| Reported by: | venom087 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | words | Keywords: | |
| Cc: | Branch: | ||
| Author: | Launchpad Bug: |
Description
I've been using Twisted Words to write an AIM bot using the oscar protocol. I needed to be able to retrieve users' status messages so I added that functionality to oscar.py. It's just three extra lines of code. The following is a patch with my changes:
Index: /words/protocols/oscar.py
===================================================================
--- /words/protocols/oscar.py (revision 22046)
+++ /words/protocols/oscar.py (working copy)
@@ -104,6 +104,7 @@
self.warning = warn
self.flags = []
self.caps = []
+ self.statusMessage = ''
for k,v in tlvs.items():
if k == 1: # user flags
v=struct.unpack('!H',v)[0]
@@ -161,6 +162,8 @@
self.sessionLength = struct.unpack('!L',v)[0]
elif k == 16: # session length (aol)
self.sessionLength = struct.unpack('!L',v)[0]
+ elif k == 29: # status message (aim)
+ self.statusMessage = v[26:len(v)-19]
elif k == 30: # no idea
pass
else:
Change History
Note: See
TracTickets for help on using
tickets.
