Skip to content

Commit b99696e

Browse files
committed
Version 1.4.4
1 parent a258285 commit b99696e

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

Sources/WebimMobileWidget/Assets/XibFiles/ChatViewController/ChatViewController/Cells/WMNilTableViewCell/Base.lproj/WMNilTableViewCell.xib

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<objects>
@@ -15,15 +15,11 @@
1515
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="kCB-bj-UQ1" id="2ri-Qc-O3O">
1616
<rect key="frame" x="0.0" y="0.0" width="414" height="1.1920928955078125e-07"/>
1717
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
18-
<constraints>
19-
<constraint firstAttribute="height" constant="1" id="dED-Me-tIA"/>
20-
</constraints>
2118
</tableViewCellContentView>
2219
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2320
<constraints>
2421
<constraint firstAttribute="trailing" secondItem="2ri-Qc-O3O" secondAttribute="trailing" id="48X-3g-kZa"/>
2522
<constraint firstItem="2ri-Qc-O3O" firstAttribute="top" secondItem="kCB-bj-UQ1" secondAttribute="top" id="4eM-8t-gcY"/>
26-
<constraint firstAttribute="bottom" secondItem="2ri-Qc-O3O" secondAttribute="bottom" constant="-0.99999988079071045" id="Lc3-6d-CJ8"/>
2723
<constraint firstItem="2ri-Qc-O3O" firstAttribute="leading" secondItem="kCB-bj-UQ1" secondAttribute="leading" id="t9O-Ba-Z3e"/>
2824
</constraints>
2925
<point key="canvasLocation" x="52.173913043478265" y="-18.415178571428569"/>

Sources/WebimMobileWidget/Classes/SDK Files/ViewControllers/ChatViewController/ChatViewController/Cells/WMBotButtonsTableViewCell/WMBotButtonsTableViewCell.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ class WMBotButtonsTableViewCell: WMMessageTableCell {
122122
/// button text insets
123123
titleLabel.snp.remakeConstraints { make in
124124
make.top.equalToSuperview().inset(10)
125-
make.height.greaterThanOrEqualTo(18)
126125
make.width.lessThanOrEqualToSuperview().inset(10)
127126
}
128127

Sources/WebimMobileWidget/Classes/SDK Files/ViewControllers/ChatViewController/ChatViewController/ChatViewController+Setup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ extension ChatViewController {
219219
let attributes = [NSAttributedString.Key.foregroundColor: refreshControlTextColour]
220220
refreshControl.addTarget(
221221
self,
222-
action: #selector(requestMessages),
222+
action: #selector(refreshMessages),
223223
for: .valueChanged
224224
)
225225
refreshControl.attributedTitle = NSAttributedString(

Sources/WebimMobileWidget/Classes/SDK Files/ViewControllers/ChatViewController/ChatViewController/ChatViewController.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,22 @@ class ChatViewController: UIViewController {
212212
}
213213

214214
@objc
215-
func requestMessages() {
215+
func refreshMessages() {
216+
requestMessages()
217+
}
218+
219+
func requestMessages(_ completionHandler: (() -> Void)? = nil) {
216220
let chatConfig = chatConfig as? WMChatViewControllerConfig
217221
WebimServiceController.currentSession.getNextMessages(messagesCount: chatConfig?.requestMessagesCount) { [weak self] messages in
218222
self?.chatMessagesQueue.async(flags: .barrier) {
219223
self?.chatMessages.insert(contentsOf: messages, at: 0)
220224
self?.messageCounter.increaseLastReadMessageIndex(with: messages.count)
221-
222225
}
223226

224227
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
225228
self?.updateThreadListAndReloadTable()
226229
self?.chatTableView.refreshControl?.endRefreshing()
230+
completionHandler?()
227231
}
228232
}
229233
}
@@ -594,16 +598,19 @@ class ChatViewController: UIViewController {
594598
self.chatMessagesQueue.async(flags: .barrier) {
595599
self.chatMessages.insert(contentsOf: messages, at: 0)
596600
DispatchQueue.main.async {
597-
if messages.count < WebimService.ChatSettings.messagesPerRequest.rawValue {
598-
self.requestMessages()
601+
self.becomeFirstResponder()
602+
if messages.count < 50 {
603+
self.requestMessages { [weak self] in
604+
self?.scrollToBottom(animated: true)
605+
}
606+
} else {
607+
self.updateThreadListAndReloadTable { [weak self] in
608+
self?.scrollToBottom(animated: true)
609+
}
599610
}
600611
}
601612
}
602-
DispatchQueue.main.async {
603-
self.becomeFirstResponder()
604-
self.updateThreadListAndReloadTable()
605-
self.scrollToBottom(animated: true)
606-
}
613+
607614
}
608615
}
609616

WebimMobileWidget.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'WebimMobileWidget'
3-
s.version = '1.4.3'
3+
s.version = '1.4.4'
44
s.summary = 'Webim.ru mobile UI for client SDK iOS.'
55

66
s.homepage = 'https://webim.ru/integration/mobile-sdk/ios-sdk-howto/'

0 commit comments

Comments
 (0)