|
|
|
@ -10,7 +10,7 @@ import bytesToHex from "../../helpers/bytes/bytesToHex";
@@ -10,7 +10,7 @@ import bytesToHex from "../../helpers/bytes/bytesToHex";
|
|
|
|
|
import deepEqual from "../../helpers/object/deepEqual"; |
|
|
|
|
import { AppManager } from "../appManagers/manager"; |
|
|
|
|
|
|
|
|
|
export type ReferenceContext = ReferenceContext.referenceContextProfilePhoto | ReferenceContext.referenceContextMessage | ReferenceContext.referenceContextEmojiesSounds | ReferenceContext.referenceContextReactions; |
|
|
|
|
export type ReferenceContext = ReferenceContext.referenceContextProfilePhoto | ReferenceContext.referenceContextMessage | ReferenceContext.referenceContextEmojiesSounds | ReferenceContext.referenceContextReactions | ReferenceContext.referenceContextUserFull; |
|
|
|
|
export namespace ReferenceContext { |
|
|
|
|
export type referenceContextProfilePhoto = { |
|
|
|
|
type: 'profilePhoto', |
|
|
|
@ -30,6 +30,11 @@ export namespace ReferenceContext {
@@ -30,6 +30,11 @@ export namespace ReferenceContext {
|
|
|
|
|
export type referenceContextReactions = { |
|
|
|
|
type: 'reactions' |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export type referenceContextUserFull = { |
|
|
|
|
type: 'userFull', |
|
|
|
|
userId: UserId |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export type ReferenceBytes = Photo.photo['file_reference']; |
|
|
|
@ -139,6 +144,11 @@ export class ReferenceDatabase extends AppManager {
@@ -139,6 +144,11 @@ export class ReferenceDatabase extends AppManager {
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case 'userFull': { |
|
|
|
|
promise = Promise.resolve(this.appProfileManager.getProfile(context.userId, true)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: { |
|
|
|
|
this.log.warn('refreshReference: not implemented context', context); |
|
|
|
|
return Promise.reject(); |
|
|
|
|