aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Murphy <alec@checksum.fail>2017-05-30 18:30:28 -0400
committerAlec Murphy <alec@checksum.fail>2017-05-30 18:30:28 -0400
commitef9f2430d36d21be68d972364db326e33835a560 (patch)
tree31702abaa6090bb48ee135d3fb16aede75a5ff52
parent160af4171327d714a54fb470ebbd5112df142af3 (diff)
Stub for attachments
-rw-r--r--crocodile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/crocodile.py b/crocodile.py
index 9c0df99..8a935a1 100644
--- a/crocodile.py
+++ b/crocodile.py
@@ -94,6 +94,10 @@ def CrocGetMsgs():
msg_ofs = BLK_SIZE
msgs_json.reverse()
for msg in msgs_json:
+ attachments = ''
+ if 'attachments' in msg:
+ for att in msg['attachments']:
+ attachments += '\n' + att['url']
os.lseek(HGBD,msg_ofs,os.SEEK_SET)
os.write(HGBD, '\x00'*2048)
os.lseek(HGBD,msg_ofs,os.SEEK_SET)
@@ -112,7 +116,7 @@ def CrocGetMsgs():
os.write(HGBD,str(msg['author']['avatar'])+'\x00')
msg_ofs += 64
os.lseek(HGBD,msg_ofs,os.SEEK_SET)
- os.write(HGBD,msg['content'].encode('utf8')+'\x00')
+ os.write(HGBD,msg['content'].encode('utf8')+attachments+'\x00')
msg_ofs += 1024
os.lseek(HGBD,0,os.SEEK_SET)
os.write(HGBD,str(msgs_cnt))