mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
Fix replying in discussions (#1954)
This commit is contained in:
parent
9b3050d179
commit
5581b2b421
@ -1147,6 +1147,7 @@ export function buildLocalMessage(
|
||||
text?: string,
|
||||
entities?: ApiMessageEntity[],
|
||||
replyingTo?: number,
|
||||
replyingToTopId?: number,
|
||||
attachment?: ApiAttachment,
|
||||
sticker?: ApiSticker,
|
||||
gif?: ApiVideo,
|
||||
@ -1181,6 +1182,7 @@ export function buildLocalMessage(
|
||||
isOutgoing: !isChannel,
|
||||
senderId: sendAs?.id || currentUserId,
|
||||
...(replyingTo && { replyToMessageId: replyingTo }),
|
||||
...(replyingToTopId && { replyToTopMessageId: replyingToTopId }),
|
||||
...(groupedId && {
|
||||
groupedId,
|
||||
...(media && (media.photo || media.video) && { isInAlbum: true }),
|
||||
|
@ -202,6 +202,7 @@ export function sendMessage(
|
||||
text,
|
||||
entities,
|
||||
replyingTo,
|
||||
replyingToTopId,
|
||||
attachment,
|
||||
sticker,
|
||||
gif,
|
||||
@ -218,6 +219,7 @@ export function sendMessage(
|
||||
text?: string;
|
||||
entities?: ApiMessageEntity[];
|
||||
replyingTo?: number;
|
||||
replyingToTopId?: number;
|
||||
attachment?: ApiAttachment;
|
||||
sticker?: ApiSticker;
|
||||
gif?: ApiVideo;
|
||||
@ -237,6 +239,7 @@ export function sendMessage(
|
||||
text,
|
||||
entities,
|
||||
replyingTo,
|
||||
replyingToTopId,
|
||||
attachment,
|
||||
sticker,
|
||||
gif,
|
||||
|
@ -912,6 +912,7 @@ async function sendMessage(params: {
|
||||
isSilent?: boolean;
|
||||
scheduledAt?: number;
|
||||
sendAs?: ApiChat | ApiUser;
|
||||
replyingToTopId?: number;
|
||||
}) {
|
||||
let localId: number | undefined;
|
||||
const progressCallback = params.attachment ? (progress: number, messageLocalId: number) => {
|
||||
@ -950,6 +951,10 @@ async function sendMessage(params: {
|
||||
params.replyingTo = selectThreadTopMessageId(global, params.chat.id, threadId)!;
|
||||
}
|
||||
|
||||
if (params.replyingTo && !params.replyingToTopId && threadId !== MAIN_THREAD_ID) {
|
||||
params.replyingToTopId = selectThreadTopMessageId(global, params.chat.id, threadId)!;
|
||||
}
|
||||
|
||||
await callApi('sendMessage', params, progressCallback);
|
||||
|
||||
if (progressCallback && localId) {
|
||||
|
Loading…
Reference in New Issue
Block a user