2021-08-05 20:17:05 -04:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2025-09-16 17:39:03 -07:00
|
|
|
import type { AvatarDataType } from '../types/Avatar.js';
|
2021-08-05 20:17:05 -04:00
|
|
|
|
|
|
|
export function isSameAvatarData(
|
|
|
|
a?: AvatarDataType,
|
|
|
|
b?: AvatarDataType
|
|
|
|
): boolean {
|
|
|
|
if (!a || !b) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (a.buffer && b.buffer) {
|
|
|
|
return a.buffer === b.buffer;
|
|
|
|
}
|
|
|
|
if (a.imagePath && b.imagePath) {
|
|
|
|
return a.imagePath === b.imagePath;
|
|
|
|
}
|
|
|
|
return a.id === b.id;
|
|
|
|
}
|