Skip to content

Commit

Permalink
Add CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
kanat authored and JcMinarro committed Jul 4, 2023
1 parent 15079e9 commit 036d80b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Added `ChatClient.inviteMembers` to invite members to an existing channel. [#4816](https://github.com/GetStream/stream-chat-android/pull/4816)
- Added `ChannelClient.inviteMembers` to invite members to an existing channel. [#4816](https://github.com/GetStream/stream-chat-android/pull/4816)
- Added `ChannelUserBannedEvent.shadow` property to know if the user is shadow-banned or standard banned. [#4836](https://github.com/GetStream/stream-chat-android/pull/4836)
- Added `AttachmentsVerifier` to verify if the uploaded attachments are valid. [#4852](https://github.com/GetStream/stream-chat-android/pull/4852)

### ⚠️ Changed
- Changed `newMessageIntent` lambda's signature of `NotificationHandlerFactory.createNotificationHandler()`. It receives the whole `Message`/`Channel` entity to help you create a more complex navigation intent.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2014-2023 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.client.attachment

import io.getstream.chat.android.models.Message
Expand All @@ -15,15 +31,13 @@ internal class AttachmentsVerifier {
val corruptedAttachment = message.attachments.find {
it.upload != null && it.imageUrl == null && it.assetUrl == null
}
if (corruptedAttachment != null) {
return if (corruptedAttachment == null) result else {
logger.e {
"[verifyAttachments] #uploader; message(${message.id}) has corrupted attachment: $corruptedAttachment"
}
return Result.Failure(
Result.Failure(
Error.GenericError("Message(${message.id}) contains corrupted attachment: $corruptedAttachment")
)
}
return result
}

}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2014-2023 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-chat-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.chat.android.client.attachment

import io.getstream.chat.android.client.test.randomMessage
Expand Down Expand Up @@ -58,5 +74,4 @@ internal class AttachmentsVerifierTests {
/* Then */
verified.isFailure `should be equal to` true
}

}
}

0 comments on commit 036d80b

Please sign in to comment.