unsetting c2dm on server when user or token doesn't match

pull/14/head
Andrew Shaw 13 years ago
parent 251913aa8f
commit 45de2cb240

@ -192,6 +192,25 @@ public class C2DMReceiver extends BroadcastReceiver {
Intent notifyIntent = null; Intent notifyIntent = null;
int notifId; int notifId;
final long user_id = intent.getLongExtra("oid", -2L);
final String token_id = intent.getStringExtra("tid");
// unregister
if (!actFmPreferenceService.isLoggedIn() || user_id != ActFmPreferenceService.userId()) {
new Thread() {
@Override
public void run() {
try {
actFmSyncService.invoke("user_unset_c2dm", "tid", token_id, "oid", user_id);
} catch (IOException e) {
//
}
}
}.start();
return;
}
// fetch data // fetch data
if(intent.hasExtra("tag_id")) { if(intent.hasExtra("tag_id")) {
notifyIntent = createTagIntent(context, intent); notifyIntent = createTagIntent(context, intent);

Loading…
Cancel
Save