Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.46.0 Release #2950

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,45 +56,45 @@
}
},
"vale": {
"version": "2.29.6",
"version": "2.30.0",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:05e3a10167a5eb5a006ee84b9475667ecffb905c91b96c8e2f14d1c8155c33f7",
"sha256": "05e3a10167a5eb5a006ee84b9475667ecffb905c91b96c8e2f14d1c8155c33f7"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:c7705e7772367c6d82cfd41dd0fe1662065aac1a50b3a35fa9fa58d652327d1c",
"sha256": "c7705e7772367c6d82cfd41dd0fe1662065aac1a50b3a35fa9fa58d652327d1c"
},
"arm64_ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:1c76354047dbab61dd6eabd57a7696fa1e018c734195f2a3162e8d7391e972ae",
"sha256": "1c76354047dbab61dd6eabd57a7696fa1e018c734195f2a3162e8d7391e972ae"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:f12ab9bf3e44bbca9c8aa65ea06058fba07c3d97739d9b44a041f607a9f4c988",
"sha256": "f12ab9bf3e44bbca9c8aa65ea06058fba07c3d97739d9b44a041f607a9f4c988"
},
"arm64_monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:47b93b5bdfd92c399e94b0410504316fdef6a52eb63b8a2a2f02a5d78e04c47b",
"sha256": "47b93b5bdfd92c399e94b0410504316fdef6a52eb63b8a2a2f02a5d78e04c47b"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:df1119b58d493a2fa7087886587e8cf602ad73419c9307a18a3e64ce4f7e0ea3",
"sha256": "df1119b58d493a2fa7087886587e8cf602ad73419c9307a18a3e64ce4f7e0ea3"
},
"sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:e62675ee738a215135d0b89d10ce6cd55d0f2ca09ec38e4a5655c70470a5417b",
"sha256": "e62675ee738a215135d0b89d10ce6cd55d0f2ca09ec38e4a5655c70470a5417b"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:e1bfa5074b197f158b34d16a0b99a774469c01b261df0f12434e0fd8221b8c81",
"sha256": "e1bfa5074b197f158b34d16a0b99a774469c01b261df0f12434e0fd8221b8c81"
},
"ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:6e50c718f460a0a77f6a62faebc94e951a4f45ac7e8701f0e26dd5508b3d79a6",
"sha256": "6e50c718f460a0a77f6a62faebc94e951a4f45ac7e8701f0e26dd5508b3d79a6"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:c95d989401b9bc4f7d0e1ee50bf8b7411fc6285c126ec3c6245a4a5eb2aba4e8",
"sha256": "c95d989401b9bc4f7d0e1ee50bf8b7411fc6285c126ec3c6245a4a5eb2aba4e8"
},
"monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:80f5018f609ee0e62f47b0cda14dfdc17c63bce9f3acc71d1415e1c0f634e575",
"sha256": "80f5018f609ee0e62f47b0cda14dfdc17c63bce9f3acc71d1415e1c0f634e575"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:03c7c04cee73031c63520a208fa3d775ec4ebb776b7e8df79aedaf4054713e1e",
"sha256": "03c7c04cee73031c63520a208fa3d775ec4ebb776b7e8df79aedaf4054713e1e"
},
"x86_64_linux": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:b94563d083ab001aeac3d6753b4cf3f5a2ae911c71794414794d1887b9726424",
"sha256": "b94563d083ab001aeac3d6753b4cf3f5a2ae911c71794414794d1887b9726424"
"url": "https://ghcr.io/v2/homebrew/core/vale/blobs/sha256:539523fa46cdefe2a4aa752756f5724fc85dddce2b7ca1163fb41cb3c613efc3",
"sha256": "539523fa46cdefe2a4aa752756f5724fc85dddce2b7ca1163fb41cb3c613efc3"
}
}
}
Expand All @@ -118,12 +118,12 @@
"system": {
"macos": {
"ventura": {
"HOMEBREW_VERSION": "4.1.17",
"HOMEBREW_VERSION": "4.1.22",
"HOMEBREW_PREFIX": "/usr/local",
"Homebrew/homebrew-core": "api",
"CLT": "15.0.0.0.1.1694021235",
"Xcode": "14.3.1",
"macOS": "13.6"
"macOS": "13.6.1"
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### πŸ”„ Changed

# [4.46.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.46.0)
_December 21, 2023_

## StreamChat
### 🐞 Fixed
- Fix duplicated Runpath Search Paths [#2937](https://github.com/GetStream/stream-chat-swift/pull/2937)
- Fix `_dispatch_lane_resume` crash in `RepeatingTimer` [#2938](https://github.com/GetStream/stream-chat-swift/pull/2938)
- Fix editing of async voice messages [#2943](https://github.com/GetStream/stream-chat-swift/pull/2943)

## StreamChatUI
### βœ… Added
- Better support for custom mixed attachments rendering [#2947](https://github.com/GetStream/stream-chat-swift/pull/2947)
### 🐞 Fixed
- Fix duplicated Runpath Search Paths [#2937](https://github.com/GetStream/stream-chat-swift/pull/2937)
- Fix file attachments not rendering file size [#2941](https://github.com/GetStream/stream-chat-swift/pull/2941)
- Fix quoted chat message view with wrong text [#2946](https://github.com/GetStream/ios-issues-tracking/issues/683)
- Fix jumping to bottom when loading new messages [#2945](https://github.com/GetStream/stream-chat-swift/pull/2945)
- Fix deleted messages always showing custom attachments [#2947](https://github.com/GetStream/stream-chat-swift/pull/2947)
- Fix messages failing to be deleted when pending updates to the server [#2949](https://github.com/GetStream/stream-chat-swift/pull/2949)

# [4.45.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.45.0)
_December 11, 2023_

Expand All @@ -29,6 +49,9 @@ _December 11, 2023_
- Fix edit action possible in giphy messages [#2926](https://github.com/GetStream/stream-chat-swift/pull/2926)
- Fix not adding a space in the message input when mentioning a user [#2927](https://github.com/GetStream/stream-chat-swift/pull/2927)

## ⚠️ Important
- iOS 11 support has been dropped since Xcode 15 does not allow publishing apps with iOS 11.

# [4.44.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.44.0)
_November 30, 2023_

Expand Down
16 changes: 3 additions & 13 deletions DemoApp/DemoAppConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

import Atlantis
import Foundation
import GDPerformanceView_Swift
import Sentry
import StreamChat
Expand All @@ -19,24 +18,15 @@ enum DemoAppConfiguration {
#endif
}

// MARK: Internal configuration

static var isStreamInternalConfiguration: Bool {
ProcessInfo.processInfo.environment["STREAM_DEV"] != nil
}

// This function is called from `DemoAppCoordinator` before the Chat UI is created
static func setInternalConfiguration() {
StreamRuntimeCheck.assertionsEnabled = isStreamInternalConfiguration
StreamRuntimeCheck._isBackgroundMappingEnabled = true
AppConfig.shared.demoAppConfig.isTokenRefreshEnabled = isStreamInternalConfiguration

StreamRuntimeCheck.assertionsEnabled = StreamRuntimeCheck.isStreamInternalConfiguration
configureAtlantisIfNeeded()
}

// HTTP and WebSocket Proxy with Proxyman.app
private static func configureAtlantisIfNeeded() {
if isStreamInternalConfiguration || AppConfig.shared.demoAppConfig.isAtlantisEnabled {
if AppConfig.shared.demoAppConfig.isAtlantisEnabled {
Atlantis.start()
} else {
Atlantis.stop()
Expand All @@ -45,7 +35,7 @@ enum DemoAppConfiguration {

// Performance tracker
static func showPerformanceTracker() {
guard isStreamInternalConfiguration else { return }
guard StreamRuntimeCheck.isStreamInternalConfiguration else { return }
// PerformanceMonitor seems to have a bug where it cannot find the hierarchy when trying to place its view
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
PerformanceMonitor.shared().performanceViewConfigurator.options = [.performance]
Expand Down
27 changes: 0 additions & 27 deletions DemoApp/Screens/AdvancedOptionsViewController.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ struct DemoAppConfig {
var isMessageDebuggerEnabled: Bool
/// A Boolean value to define if channel pinning example is enabled.
var isChannelPinningEnabled: Bool
/// A Boolean value to define if custom location attachments are enabled.
var isLocationAttachmentsEnabled: Bool
}

class AppConfig {
Expand All @@ -33,8 +35,18 @@ class AppConfig {
isAtlantisEnabled: false,
isTokenRefreshEnabled: false,
isMessageDebuggerEnabled: false,
isChannelPinningEnabled: false
isChannelPinningEnabled: false,
isLocationAttachmentsEnabled: false
)

StreamRuntimeCheck._isBackgroundMappingEnabled = true

if StreamRuntimeCheck.isStreamInternalConfiguration {
demoAppConfig.isAtlantisEnabled = true
demoAppConfig.isMessageDebuggerEnabled = true
demoAppConfig.isLocationAttachmentsEnabled = true
demoAppConfig.isTokenRefreshEnabled = true
}
}
}

Expand Down Expand Up @@ -137,6 +149,8 @@ class AppConfigViewController: UITableViewController {
case isAtlantisEnabled
case isMessageDebuggerEnabled
case isChannelPinningEnabled
case isLocationAttachmentsEnabled
case isBackgroundMappingEnabled
}

enum ComponentsConfigOption: String, CaseIterable {
Expand Down Expand Up @@ -270,6 +284,14 @@ class AppConfigViewController: UITableViewController {
cell.accessoryView = makeSwitchButton(demoAppConfig.isChannelPinningEnabled) { [weak self] newValue in
self?.demoAppConfig.isChannelPinningEnabled = newValue
}
case .isLocationAttachmentsEnabled:
cell.accessoryView = makeSwitchButton(demoAppConfig.isLocationAttachmentsEnabled) { [weak self] newValue in
self?.demoAppConfig.isLocationAttachmentsEnabled = newValue
}
case .isBackgroundMappingEnabled:
cell.accessoryView = makeSwitchButton(StreamRuntimeCheck._isBackgroundMappingEnabled) { newValue in
StreamRuntimeCheck._isBackgroundMappingEnabled = newValue
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Screens/UserProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class UserProfileViewController: UIViewController, CurrentChatUserControllerDele
updateButton.backgroundColor = .systemBlue
updateButton.contentEdgeInsets = UIEdgeInsets(top: 0.0, left: 15, bottom: 0.0, right: 15)
updateButton.addTarget(self, action: #selector(didTapUpdateButton), for: .touchUpInside)
updateButton.isHidden = !DemoAppConfiguration.isStreamInternalConfiguration
updateButton.isHidden = !StreamRuntimeCheck.isStreamInternalConfiguration

NSLayoutConstraint.activate([
imageView.widthAnchor.constraint(equalToConstant: 60),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Copyright Β© 2023 Stream.io Inc. All rights reserved.
//

import StreamChat
import StreamChatUI

class DemoAttachmentViewCatalog: AttachmentViewCatalog {
override class func attachmentViewInjectorClassFor(message: ChatMessage, components: Components) -> AttachmentViewInjector.Type? {
let hasMultipleAttachmentTypes = message.attachmentCounts.keys.count > 1
let hasLocationAttachment = message.attachmentCounts.keys.contains(.location)
if AppConfig.shared.demoAppConfig.isLocationAttachmentsEnabled && hasLocationAttachment {
if hasMultipleAttachmentTypes {
return MixedAttachmentViewInjector.self
}
return LocationAttachmentViewInjector.self
}

return super.attachmentViewInjectorClassFor(message: message, components: components)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Copyright Β© 2023 Stream.io Inc. All rights reserved.
//

import StreamChatUI

class DemoChatMessageListVC: ChatMessageListVC {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// Copyright Β© 2023 Stream.io Inc. All rights reserved.
//

import StreamChat
import StreamChatUI
import UIKit

class DemoComposerVC: ComposerVC {
/// For demo purposes the locations are hard-coded.
var dummyLocations: [(latitude: Double, longitude: Double)] = [
(38.708442, -9.136822), // Lisbon, Portugal
(37.983810, 23.727539), // Athens, Greece
(53.149118, -6.079341), // Greystones, Ireland
(41.11722, 20.80194), // Ohrid, Macedonia
(51.5074, -0.1278), // London, United Kingdom
(52.5200, 13.4050), // Berlin, Germany
(40.4168, -3.7038), // Madrid, Spain
(50.4501, 30.5234), // Kyiv, Ukraine
(41.9028, 12.4964), // Rome, Italy
(48.8566, 2.3522), // Paris, France
(44.4268, 26.1025), // Bucharest, Romania
(48.2082, 16.3738), // Vienna, Austria
(47.4979, 19.0402) // Budapest, Hungary
]

override var attachmentsPickerActions: [UIAlertAction] {
var actions = super.attachmentsPickerActions

let alreadyHasLocation = content.attachments.map(\.type).contains(.location)
if AppConfig.shared.demoAppConfig.isLocationAttachmentsEnabled && !alreadyHasLocation {
let sendLocationAction = UIAlertAction(
title: "Location",
style: .default,
handler: { [weak self] _ in self?.sendLocation() }
)
actions.append(sendLocationAction)
}

return actions
}

func sendLocation() {
guard let location = dummyLocations.randomElement() else { return }
let locationAttachmentPayload = LocationAttachmentPayload(
coordinate: .init(latitude: location.latitude, longitude: location.longitude)
)

content.attachments.append(AnyAttachmentPayload(payload: locationAttachmentPayload))

// In case you would want to send the location directly, without composer preview:
// channelController?.createNewMessage(text: "", attachments: [.init(
// payload: locationAttachmentPayload
// )])
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Copyright Β© 2023 Stream.io Inc. All rights reserved.
//

import StreamChat
import StreamChatUI
import UIKit

class DemoQuotedChatMessageView: QuotedChatMessageView {
override func setAttachmentPreview(for message: ChatMessage) {
let locationAttachments = message.attachments(payloadType: LocationAttachmentPayload.self)
if let locationPayload = locationAttachments.first?.payload {
attachmentPreviewView.contentMode = .scaleAspectFit
attachmentPreviewView.image = UIImage(
systemName: "mappin.circle.fill",
withConfiguration: UIImage.SymbolConfiguration(font: .boldSystemFont(ofSize: 12))
)
attachmentPreviewView.tintColor = .systemRed
textView.text = """
Location:
(\(locationPayload.coordinate.latitude),\(locationPayload.coordinate.longitude))
"""
return
}

super.setAttachmentPreview(for: message)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Copyright Β© 2023 Stream.io Inc. All rights reserved.
//

import StreamChatUI
import UIKit

/// Location Attachment Composer Preview
extension LocationAttachmentPayload: AttachmentPreviewProvider {
public static let preferredAxis: NSLayoutConstraint.Axis = .vertical

public func previewView(components: Components) -> UIView {
/// For simplicity, we are using the same view for the Composer preview,
/// but a different one could be provided.
let preview = LocationAttachmentSnapshotView()
preview.coordinate = coordinate
return preview
}
}
Loading
Loading