Fix some identifies
This commit is contained in:
parent
beebb77bce
commit
2fb747c584
@ -53,7 +53,7 @@ export default class AppNewGroupTab extends SliderSuperTab {
|
||||
const title = this.groupNameInputField.value;
|
||||
|
||||
this.nextBtn.disabled = true;
|
||||
appChatsManager.createChat(title, this.peerIds).then((chatId) => {
|
||||
appChatsManager.createChat(title, this.peerIds.map(peerId => peerId.toUserId())).then((chatId) => {
|
||||
if(this.uploadAvatar) {
|
||||
this.uploadAvatar().then((inputFile) => {
|
||||
appChatsManager.editPhoto(chatId, inputFile);
|
||||
@ -81,10 +81,10 @@ export default class AppNewGroupTab extends SliderSuperTab {
|
||||
this.nextBtn.disabled = false;
|
||||
}
|
||||
|
||||
public open(userIds: PeerId[]) {
|
||||
public open(peerIds: PeerId[]) {
|
||||
const result = super.open();
|
||||
result.then(() => {
|
||||
this.peerIds = userIds;
|
||||
this.peerIds = peerIds;
|
||||
|
||||
this.peerIds.forEach(userId => {
|
||||
let {dom} = appDialogsManager.addDialogNew({
|
||||
|
@ -31,7 +31,7 @@ export default class AppEditContactTab extends SliderSuperTab {
|
||||
|
||||
protected init() {
|
||||
this.container.classList.add('edit-peer-container', 'edit-contact-container');
|
||||
const isNew = !appUsersManager.isContact(this.peerId);
|
||||
const isNew = !appUsersManager.isContact(this.peerId.toUserId());
|
||||
this.setTitle(isNew ? 'AddContactTitle' : 'Edit');
|
||||
|
||||
{
|
||||
|
@ -433,7 +433,7 @@ export default class AppSharedMediaTab extends SliderSuperTab {
|
||||
private toggleEditBtn() {
|
||||
let show: boolean;
|
||||
if(this.peerId.isUser()) {
|
||||
show = this.peerId !== rootScope.myId && appUsersManager.isContact(this.peerId);
|
||||
show = this.peerId !== rootScope.myId && appUsersManager.isContact(this.peerId.toUserId());
|
||||
} else {
|
||||
show = appChatsManager.hasRights(this.peerId.toChatId(), 'change_info');
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export default function getRichElementValue(node: HTMLElement, lines: string[],
|
||||
_: tag.entityName,
|
||||
offset: offset.offset,
|
||||
length: nodeValue.length,
|
||||
user_id: parentElement.dataset.follow
|
||||
user_id: parentElement.dataset.follow.toUserId()
|
||||
});
|
||||
} else {
|
||||
entities.push({
|
||||
|
@ -25,7 +25,7 @@ Number.prototype.toUserId = function() {
|
||||
};
|
||||
|
||||
Number.prototype.toChatId = function() {
|
||||
return -this;
|
||||
return Math.abs(this as any);
|
||||
};
|
||||
|
||||
Number.prototype.toPeerId = function(isChat?: boolean) {
|
||||
|
@ -535,8 +535,8 @@ export class AppImManager {
|
||||
}
|
||||
|
||||
case INTERNAL_LINK_TYPE.PRIVATE_POST: {
|
||||
const chatId: ChatId = link.channel;
|
||||
const peerId = link.channel.toPeerId(true);
|
||||
const chatId = link.channel.toChatId();
|
||||
const peerId = chatId.toPeerId(true);
|
||||
|
||||
const chat = appChatsManager.getChat(chatId);
|
||||
if(chat.deleted) {
|
||||
|
@ -107,7 +107,7 @@ export class AppInlineBotsManager {
|
||||
public switchToPM(fromPeerId: PeerId, botId: BotId, startParam: string) {
|
||||
this.setHash[botId] = {peerId: fromPeerId, time: Date.now()};
|
||||
rootScope.dispatchEvent('history_focus', {peerId: botId.toPeerId()});
|
||||
return appMessagesManager.startBot(botId, '0', startParam);
|
||||
return appMessagesManager.startBot(botId, undefined, startParam);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3069,7 +3069,7 @@ export class AppMessagesManager {
|
||||
});
|
||||
}
|
||||
|
||||
public startBot(botId: BotId, chatId: ChatId, startParam: string) {
|
||||
public startBot(botId: BotId, chatId?: ChatId, startParam?: string) {
|
||||
const peerId = chatId ? chatId.toPeerId(true) : botId.toPeerId();
|
||||
if(startParam) {
|
||||
const randomId = randomLong();
|
||||
|
@ -170,7 +170,7 @@ export class AppProfileManager {
|
||||
appUsersManager.saveApiUser(user, true);
|
||||
|
||||
if(userFull.profile_photo) {
|
||||
userFull.profile_photo = appPhotosManager.savePhoto(userFull.profile_photo, {type: 'profilePhoto', peerId: peerId});
|
||||
userFull.profile_photo = appPhotosManager.savePhoto(userFull.profile_photo, {type: 'profilePhoto', peerId});
|
||||
}
|
||||
|
||||
if(userFull.about !== undefined) {
|
||||
@ -262,7 +262,7 @@ export class AppProfileManager {
|
||||
appUsersManager.saveApiUsers(result.users);
|
||||
const fullChat = result.full_chat as ChatFull.chatFull;
|
||||
if(fullChat && fullChat.chat_photo && fullChat.chat_photo.id) {
|
||||
fullChat.chat_photo = appPhotosManager.savePhoto(fullChat.chat_photo, {type: 'profilePhoto', peerId: peerId});
|
||||
fullChat.chat_photo = appPhotosManager.savePhoto(fullChat.chat_photo, {type: 'profilePhoto', peerId});
|
||||
}
|
||||
|
||||
//appMessagesManager.savePinnedMessage(peerId, fullChat.pinned_msg_id);
|
||||
|
@ -31,7 +31,6 @@ import telegramMeWebManager from './telegramMeWebManager';
|
||||
import { CacheStorageDbName } from '../cacheStorage';
|
||||
import { pause } from '../../helpers/schedulers/pause';
|
||||
import IS_WEBP_SUPPORTED from '../../environment/webpSupport';
|
||||
import appUsersManager from '../appManagers/appUsersManager';
|
||||
|
||||
type Task = {
|
||||
taskId: number,
|
||||
|
@ -305,7 +305,7 @@ namespace RichTextProcessor {
|
||||
} else if(match[11]) { // custom mention
|
||||
entity = {
|
||||
_: 'messageEntityMentionName',
|
||||
user_id: match[10],
|
||||
user_id: match[10].toUserId(),
|
||||
offset: matchIndex,
|
||||
length: text.length
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user