mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 12:24:46 +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;
|
||||
}
|
||||
|
||||
const result = await invokeRequest(new GramJs.messages.SetTyping({
|
||||
peer: buildInputPeer(peer.id, peer.accessHash),
|
||||
topMsgId: threadId,
|
||||
action: gramAction,
|
||||
}));
|
||||
return result;
|
||||
try {
|
||||
const result = await invokeRequest(new GramJs.messages.SetTyping({
|
||||
peer: buildInputPeer(peer.id, peer.accessHash),
|
||||
topMsgId: threadId,
|
||||
action: gramAction,
|
||||
}), undefined, true);
|
||||
return result;
|
||||
} catch (error) {
|
||||
// Prevent error from being displayed in UI
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export async function markMessageListRead({
|
||||
|
@ -75,7 +75,9 @@ import {
|
||||
import {
|
||||
debounce, onTickEnd, rafPromise,
|
||||
} from '../../../util/schedulers';
|
||||
import { getMessageOriginalId, getUserFullName, isServiceNotificationMessage } from '../../helpers';
|
||||
import {
|
||||
getMessageOriginalId, getUserFullName, isDeletedUser, isServiceNotificationMessage, isUserBot,
|
||||
} from '../../helpers';
|
||||
import { getTranslation } from '../../../util/langProvider';
|
||||
import { ensureProtocol } from '../../../util/ensureProtocol';
|
||||
|
||||
@ -332,6 +334,8 @@ addActionHandler('saveDraft', (global, actions, payload) => {
|
||||
|
||||
const { text, entities } = draft;
|
||||
const chat = selectChat(global, chatId)!;
|
||||
const user = selectUser(global, chatId)!;
|
||||
if (user && isDeletedUser(user)) return undefined;
|
||||
|
||||
if (threadId === MAIN_THREAD_ID) {
|
||||
void callApi('saveDraft', {
|
||||
@ -484,6 +488,8 @@ addActionHandler('sendMessageAction', async (global, actions, payload) => {
|
||||
|
||||
const chat = selectChat(global, chatId)!;
|
||||
if (!chat) return;
|
||||
const user = selectUser(global, chatId);
|
||||
if (user && (isUserBot(user) || isDeletedUser(user))) return;
|
||||
|
||||
await callApi('sendMessageAction', {
|
||||
peer: chat, threadId, action,
|
||||
|
Loading…
Reference in New Issue
Block a user