Permalink
Browse files

Merge branch 'master' of https://github.com/jaseemabid/fooChat

  • Loading branch information...
2 parents d1e9476 + 46fa85d commit 779ee0598102a1f1c25463b1e49f5a9a28f6d6f3 @jaseemabid committed Apr 19, 2012
Showing with 7 additions and 2 deletions.
  1. +6 −1 commons.py
  2. +1 −1 views.py
View
@@ -38,10 +38,15 @@ def checkUserExists(email):
return True
else:
return False
-
+
def getUserDetails(email):
if checkUserExists(email) :
user = db.view('byEmail/userDetails',key=email).rows[0]
return (user["value"][0],user["value"][1])
else:
return (0,0)
+
+def getUserIdFromUsername(username):
+ user = db.view('byUsername/userId',key=username).rows[0]
+ return user["value"]
+
View
@@ -74,7 +74,7 @@ def newMessage():
data['from']['username'] = request.json['from']['username']
data['from']['uid'] = request.json['from']['uid']
data['to']['username'] = request.json['to']['username']
- data['to']['uid'] = '3d123352c8c4c8866f5158acc60010d7' # Default to vipin, rewrite.
+ data['to']['uid'] = commons.emailHash()
data['timestamp'] = request.json['timestamp']
data['read'] = 'false'
db.save(data)

0 comments on commit 779ee05

Please sign in to comment.