Add incoming message sources to active token dir.

This commit is contained in:
Moxie Marlinspike 2013-10-12 03:57:17 -07:00
parent 1ac32346c1
commit eb4cc7f4e5

View File

@ -9,6 +9,7 @@ import org.thoughtcrime.securesms.service.RegistrationService;
import org.thoughtcrime.securesms.service.SendReceiveService;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.textsecure.crypto.InvalidVersionException;
import org.whispersystems.textsecure.directory.Directory;
import org.whispersystems.textsecure.push.IncomingEncryptedPushMessage;
import org.whispersystems.textsecure.push.IncomingPushMessage;
import org.whispersystems.textsecure.push.PushServiceSocket;
@ -62,6 +63,9 @@ public class GcmIntentService extends GCMBaseIntentService {
service.setAction(SendReceiveService.RECEIVE_PUSH_ACTION);
service.putExtra("message", message);
Directory directory = Directory.getInstance(context);
directory.setToken(directory.getToken(message.getSource()), true);
context.startService(service);
} catch (IOException e) {
Log.w("GcmIntentService", e);