- public void updateProfile(SignalServiceAddress serviceAddress, SignalProfileEntry profile) {
- profiles.put(serviceAddress, profile);
+ public void updateProfile(SignalServiceAddress serviceAddress, ProfileKey profileKey, long now, SignalProfile profile) {
+ SignalProfileEntry newEntry = new SignalProfileEntry(serviceAddress, profileKey, now, profile);
+ for (int i = 0; i < profiles.size(); i++) {
+ if (profiles.get(i).getServiceAddress().matches(serviceAddress)) {
+ profiles.set(i, newEntry);
+ return;
+ }
+ }
+
+ profiles.add(newEntry);