File tree 1 file changed +6
-5
lines changed
Slack.Backup/Private/backup
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,24 @@ function Invoke-ChannelBackup {
22
22
Write-Verbose " Get-ChannelNewMessages [$ChannelId ][$ ( Convert-EpochToDate $Start ) ]"
23
23
[array ]$newMessages = Get-FullHistory - Token $Token - ChannelId $ChannelId - Start $start
24
24
25
- $ids = $messages.client_msg_id
25
+ $ids = $messages.ts
26
26
$threadDeep = Convert-DateToEpoch (Get-Date ).AddDays(-90 )
27
- $threaded = $messages | ? { $_.reply_count -ne $null } | ? { [double ]$_.ts -le $start -and [double ]$_.ts -gt $threadDeep }
27
+ $threaded = $messages | ? { $_.latest_reply -ne $null } | ? { [double ]$_.ts -le $start -and [double ]$_.ts -gt $threadDeep }
28
28
$threaded | % {
29
29
$om = $_
30
- $response = Get-Thread - Token $Token - ChannelId $ChannelId - ThreadTs $om.thread_ts
30
+ $response = Get-Thread - Token $Token - ChannelId $ChannelId - ThreadTs $om.ts
31
31
if ($response.ok -eq $true ) {
32
32
$replies = $response.messages
33
33
$nm = $replies | Select-Object - First 1
34
34
if ($nm -and ([double ]$nm.latest_reply ) -gt ([double ]$om.latest_reply )) {
35
35
Write-Verbose " Update parent message: $ ( $om.client_msg_id ) "
36
36
$index = $messages.IndexOf ($om )
37
- $messages.Item ($index ) = $nm
37
+ $nmp = Invoke-MessageProcessingPipeline - SlackMessage $nm
38
+ $messages.Item ($index ) = $nmp
38
39
39
40
$replies | Select-Object - Skip 1 | % {
40
41
$m = $_
41
- if ($ids.Contains ($m.client_msg_id ) -eq $false ) {
42
+ if ($ids.Contains ($m.ts ) -eq $false ) {
42
43
Write-Verbose " Adding new thread meassage: $ ( $m.client_msg_id ) "
43
44
$newMessages += $m
44
45
}
You can’t perform that action at this time.
0 commit comments