@@ -63,7 +63,8 @@ fun PerformForwardFromMyName(
6363 sendingMessageObjects : ArrayList <MessageObject >,
6464 currentAccount : Int ,
6565 parentFragment : BaseFragment ? ,
66- notify : Boolean ) {
66+ notify : Boolean ,
67+ monoForumPeerId : Long = 0L) {
6768
6869 val queue = ArrayList < () -> Unit > ();
6970 val saveOriginalCaptions = (text == null )
@@ -101,6 +102,7 @@ fun PerformForwardFromMyName(
101102 parentFragment,
102103 copyText,
103104 notify,
105+ monoForumPeerId,
104106 deque)
105107 }
106108 }
@@ -122,7 +124,7 @@ fun PerformForwardFromMyName(
122124 val copyText = currentReplaceText();
123125 queue.add {
124126 val instance = SendMessagesHelper .getInstance(currentAccount);
125- instance.processForwardFromMyName(copyMsg, key, 0 , topicId , null , copyText, notify, topicId)
127+ instance.processForwardFromMyName(copyMsg, key, 0 , 0 , null , copyText, notify, topicId, monoForumPeerId )
126128 deque();
127129 }
128130 }
@@ -140,7 +142,8 @@ fun GroupItemsIntoAlbum(
140142 sendingMessageObjects : ArrayList <MessageObject >,
141143 currentAccount : Int ,
142144 parentFragment : BaseFragment ? ,
143- notify : Boolean ) {
145+ notify : Boolean ,
146+ monoForumPeerId : Long = 0L) {
144147 if (sendingMessageObjects.isEmpty()) {
145148 return ;
146149 }
@@ -153,7 +156,7 @@ fun GroupItemsIntoAlbum(
153156 val objectsToDelay = sub(objectsToSend.size, sendingMessageObjects.size);
154157
155158 val finish = {
156- GroupItemsIntoAlbum (key, reply, text, objectsToDelay, currentAccount, parentFragment, notify)
159+ GroupItemsIntoAlbum (key, reply, text, objectsToDelay, currentAccount, parentFragment, notify, monoForumPeerId )
157160 };
158161
159162 SendItemsAsAlbum (
@@ -164,6 +167,7 @@ fun GroupItemsIntoAlbum(
164167 parentFragment,
165168 text,
166169 notify,
170+ monoForumPeerId,
167171 finish)
168172}
169173
@@ -211,12 +215,13 @@ fun SendItemsAsAlbum(
211215 fragment : BaseFragment ? ,
212216 replaceText : String? ,
213217 notify : Boolean ,
218+ monoForumPeerId : Long = 0L,
214219 finish : () -> Unit ) {
215220 if (peer == 0L || messages.size > 10 || messages.isEmpty()) {
216221 return
217222 }
218223 val accountInstance = AccountInstance .getInstance(currentAccount)
219- val lower_id = peer
224+ val lower_id = if (monoForumPeerId != 0L ) monoForumPeerId else peer
220225 val sendToPeer: InputPeer =
221226 (if (lower_id != 0L ) accountInstance.messagesController.getInputPeer(lower_id)
222227 else null )
@@ -306,7 +311,7 @@ fun SendItemsAsAlbum(
306311 showToast(" Sorry, something went wrong." );
307312 return @handleMessages
308313 }
309- SendItemsAsAlbum (currentAccount, messages, peer, reply, fragment, replaceText, notify, finish)
314+ SendItemsAsAlbum (currentAccount, messages, peer, reply, fragment, replaceText, notify, monoForumPeerId, finish)
310315 }
311316
312317 ForkApi .TLRPCMessages (currentAccount, messages, handleMessages);
0 commit comments