mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 11:56:47 +00:00
Support for receiving "canonical id" update events from pushserver.
// FREEBIE
This commit is contained in:
1 parent
456164fc24
commit
e69e395b25
2 files changed
+14
-1
No files matched your search
@@ -11,6 +11,9 @@ public class UnregisteredEvent {
|
||||
@NotEmpty
|
||||
private String registrationId;
|
||||
|
||||
@JsonProperty
|
||||
private String canonicalId;
|
||||
|
||||
@JsonProperty
|
||||
@NotEmpty
|
||||
private String number;
|
||||
@@ -26,6 +29,10 @@ public class UnregisteredEvent {
|
||||
return registrationId;
|
||||
}
|
||||
|
||||
public String getCanonicalId() {
|
||||
return canonicalId;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,13 @@ public class FeedbackHandler implements Managed, Runnable {
|
||||
event.getTimestamp() > device.get().getPushTimestamp())
|
||||
{
|
||||
logger.info("GCM Unregister Timestamp matches!");
|
||||
device.get().setGcmId(null);
|
||||
|
||||
if (event.getCanonicalId() != null && !event.getCanonicalId().isEmpty()) {
|
||||
logger.info("It's a canonical ID update...");
|
||||
device.get().setGcmId(event.getCanonicalId());
|
||||
} else {
|
||||
device.get().setGcmId(null);
|
||||
}
|
||||
accountsManager.update(account.get());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user