Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying to cleanup push a bit.

  • Loading branch information...
commit 269dc7785ae97459cbde2d2e2666be9cbb67bc7d 1 parent d66e710
@patrickbaumann patrickbaumann authored
Showing with 5 additions and 6 deletions.
  1. +4 −5 geocamTalk/models.py
  2. +1 −1  geocamTalk/views.py
View
9 geocamTalk/models.py
@@ -116,8 +116,7 @@ def has_audio(self):
return bool(self.audio_file != '')
def push_to_phone(self, pushToSender = True):
- message = self
-
+
# NOW SEND THE REQUEST TO GOOGLE SERVERS
# first we need an https connection that ignores the certificate (for now)
httpsconnection = httplib.HTTPSConnection("android.apis.google.com", 443)
@@ -128,12 +127,12 @@ def push_to_phone(self, pushToSender = True):
for user in push_recipients:
if(user.profile.registration_id):
- if(pushToSender or user.pk != message.author.pk):
+ if(pushToSender == True or user.pk != self.author.pk):
# we need the following params set per http://code.google.com/android/c2dm/index.html#push
params = urllib.urlencode({
'registration_id': user.profile.registration_id,
- 'collapse_key': "message"+str(message.pk),
- 'data.message_id': str(message.pk),
+ 'collapse_key': "message"+str(self.pk),
+ 'data.message_id': str(self.pk),
'delay_when_idle':'TRUE',
})
View
2  geocamTalk/views.py
@@ -129,7 +129,7 @@ def create_message(request):
msg.content_timestamp = datetime.now()
msg.save()
form.save_m2m()
- msg.push_to_phone()
+ msg.push_to_phone(True)
return HttpResponseRedirect(reverse("talk_message_list_all"))
else:
return render_to_response('geocamTalk/message_form.html',
Please sign in to comment.
Something went wrong with that request. Please try again.