mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
Composer: Fix error when opening chat with read-only restriction (again) (#2044)
This commit is contained in:
parent
58d8242d17
commit
923c3ee12e
@ -734,12 +734,17 @@ export async function sendMessageAction({
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const result = await invokeRequest(new GramJs.messages.SetTyping({
|
const result = await invokeRequest(new GramJs.messages.SetTyping({
|
||||||
peer: buildInputPeer(peer.id, peer.accessHash),
|
peer: buildInputPeer(peer.id, peer.accessHash),
|
||||||
topMsgId: threadId,
|
topMsgId: threadId,
|
||||||
action: gramAction,
|
action: gramAction,
|
||||||
}));
|
}), undefined, true);
|
||||||
return result;
|
return result;
|
||||||
|
} catch (error) {
|
||||||
|
// Prevent error from being displayed in UI
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function markMessageListRead({
|
export async function markMessageListRead({
|
||||||
|
@ -75,7 +75,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
debounce, onTickEnd, rafPromise,
|
debounce, onTickEnd, rafPromise,
|
||||||
} from '../../../util/schedulers';
|
} from '../../../util/schedulers';
|
||||||
import { getMessageOriginalId, getUserFullName, isServiceNotificationMessage } from '../../helpers';
|
import {
|
||||||
|
getMessageOriginalId, getUserFullName, isDeletedUser, isServiceNotificationMessage, isUserBot,
|
||||||
|
} from '../../helpers';
|
||||||
import { getTranslation } from '../../../util/langProvider';
|
import { getTranslation } from '../../../util/langProvider';
|
||||||
import { ensureProtocol } from '../../../util/ensureProtocol';
|
import { ensureProtocol } from '../../../util/ensureProtocol';
|
||||||
|
|
||||||
@ -332,6 +334,8 @@ addActionHandler('saveDraft', (global, actions, payload) => {
|
|||||||
|
|
||||||
const { text, entities } = draft;
|
const { text, entities } = draft;
|
||||||
const chat = selectChat(global, chatId)!;
|
const chat = selectChat(global, chatId)!;
|
||||||
|
const user = selectUser(global, chatId)!;
|
||||||
|
if (user && isDeletedUser(user)) return undefined;
|
||||||
|
|
||||||
if (threadId === MAIN_THREAD_ID) {
|
if (threadId === MAIN_THREAD_ID) {
|
||||||
void callApi('saveDraft', {
|
void callApi('saveDraft', {
|
||||||
@ -484,6 +488,8 @@ addActionHandler('sendMessageAction', async (global, actions, payload) => {
|
|||||||
|
|
||||||
const chat = selectChat(global, chatId)!;
|
const chat = selectChat(global, chatId)!;
|
||||||
if (!chat) return;
|
if (!chat) return;
|
||||||
|
const user = selectUser(global, chatId);
|
||||||
|
if (user && (isUserBot(user) || isDeletedUser(user))) return;
|
||||||
|
|
||||||
await callApi('sendMessageAction', {
|
await callApi('sendMessageAction', {
|
||||||
peer: chat, threadId, action,
|
peer: chat, threadId, action,
|
||||||
|
Loading…
Reference in New Issue
Block a user