~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/uis/web/handler.py

  • Committer: AJ00200
  • Date: 2011-11-05 20:49:21 UTC
  • Revision ID: git-v1:7dea85d601899d3d318cbf63da6fb81bbbe3e33a
Added the ability to send messages, syncing with other computer

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from urllib import unquote_plus
 
2
import hashlib
2
3
 
3
4
import libs.events
4
5
import libs.globals
57
58
            ))
58
59
            libs.globals.global_vars['running'] = False
59
60
            libs.threadmanager.killall()
 
61
        elif path.startswith('/make_post.cgi?'):
 
62
            parameters = unquote_pluz(path.split('?')[-1]).split('&')
 
63
            for parameter in parameters:
 
64
                item = parameter.split('=')
 
65
                if item[0] == 'post':
 
66
                    post_contents = item[1]
 
67
            for friend in libs.globals.global_vars['friends']:
 
68
                friend.send_message(
 
69
                        libs.globals.global_vars['config']['username'],
 
70
                        hashlib.sha256(post_contents).hexdigest(),
 
71
                        post_contents)
60
72
        elif path == '/friends.html':
61
73
            connection.send_response(200)
62
74
            connection.send_header('Content-type', 'text/html')