Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit 61f51fb

Browse files
authored
Merge pull request #419 from zapcannon87/master
Release v2.3.11
2 parents cc714e9 + 289f27e commit 61f51fb

File tree

6 files changed

+59
-33
lines changed

6 files changed

+59
-33
lines changed

ChatKit-OC/Podfile.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
PODS:
2-
- AVOSCloud (11.4.9)
3-
- AVOSCloudIM (11.4.9):
4-
- AVOSCloud (= 11.4.9)
5-
- AVOSCloudIM/_ARC (= 11.4.9)
6-
- AVOSCloudIM/_NOARC (= 11.4.9)
7-
- AVOSCloudIM/_ARC (11.4.9):
8-
- AVOSCloud (= 11.4.9)
9-
- AVOSCloudIM/_NOARC (= 11.4.9)
10-
- AVOSCloudIM/_NOARC (11.4.9):
11-
- AVOSCloud (= 11.4.9)
12-
- ChatKit (2.3.10):
13-
- AVOSCloud (~> 11.4.9)
14-
- AVOSCloudIM (~> 11.4.9)
2+
- AVOSCloud (11.5.1)
3+
- AVOSCloudIM (11.5.1):
4+
- AVOSCloud (= 11.5.1)
5+
- AVOSCloudIM/_ARC (= 11.5.1)
6+
- AVOSCloudIM/_NOARC (= 11.5.1)
7+
- AVOSCloudIM/_ARC (11.5.1):
8+
- AVOSCloud (= 11.5.1)
9+
- AVOSCloudIM/_NOARC (= 11.5.1)
10+
- AVOSCloudIM/_NOARC (11.5.1):
11+
- AVOSCloud (= 11.5.1)
12+
- ChatKit (2.3.11):
13+
- AVOSCloud (~> 11.5.1)
14+
- AVOSCloudIM (~> 11.5.1)
1515
- CYLDeallocBlockExecutor (~> 1.1.2)
1616
- DACircularProgress (~> 2.3.1)
1717
- FDStackView (~> 1.0)
@@ -89,9 +89,9 @@ EXTERNAL SOURCES:
8989
:path: "../"
9090

9191
SPEC CHECKSUMS:
92-
AVOSCloud: 1ad969db6e24c41ae1788d68698255d853883069
93-
AVOSCloudIM: 712144be9ee5428c0bf895cf65954a0791b8364b
94-
ChatKit: 408a313d5866cc5c69e059b1539cdaa0eccaa5f7
92+
AVOSCloud: 3a337ec2290fe3b4411cd4098895323bc5a1133c
93+
AVOSCloudIM: dd3ce21e697dd8af78645cee27c31d0e29121f14
94+
ChatKit: 177fc3a1f7564142a0b0c77d64ffe8468fb5ccd2
9595
CYLDeallocBlockExecutor: ecf39e45dcead9e120f460df5668b8f5093d178e
9696
CYLTabBarController: 8d99fccf22866fe18c978c5ff863dc6051da45ff
9797
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
@@ -114,4 +114,4 @@ SPEC CHECKSUMS:
114114

115115
PODFILE CHECKSUM: 0c9077ef2ff9a92e0adcca86bcabd425df220379
116116

117-
COCOAPODS: 1.6.0.beta.2
117+
COCOAPODS: 1.6.0

ChatKit.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ChatKit"
3-
s.version = "2.3.10"
3+
s.version = "2.3.11"
44
s.summary = "An IM App Framework, support sending text, pictures, audio, video, location messaging, managing address book, more interesting features."
55
s.homepage = "https://github.com/LeanCloud/ChatKit-OC"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }
@@ -13,8 +13,8 @@ Pod::Spec.new do |s|
1313
s.resources = 'ChatKit/Class/Resources/*', 'ChatKit/**/*.xib'
1414

1515
s.requires_arc = true
16-
s.dependency "AVOSCloud" , "~> 11.4.9"
17-
s.dependency "AVOSCloudIM", "~> 11.4.9"
16+
s.dependency "AVOSCloud" , "~> 11.5.1"
17+
s.dependency "AVOSCloudIM", "~> 11.5.1"
1818
s.dependency "MJRefresh" , "~> 3.1.9"
1919
s.dependency "Masonry" , "~> 1.0.1"
2020
s.dependency "SDWebImage" , "~> 3.8.0"

ChatKit/Class/Module/Base/LCCKBaseConversationViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
*/
4141
- (void)scrollToBottomAnimated:(BOOL)animated;
4242

43+
- (void)newScrollToBottomAnimated:(BOOL)animated;
44+
4345
- (void)loadMoreMessagesScrollTotop;
4446
/**
4547
* 判断是否用户手指滚动

ChatKit/Class/Module/Base/LCCKBaseConversationViewController.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ - (void)scrollToBottomAnimated:(BOOL)animated {
139139
}
140140
}
141141

142+
- (void)newScrollToBottomAnimated:(BOOL)animated {
143+
if (!self.allowScrollToBottom) {
144+
return;
145+
}
146+
NSInteger rows = [self.tableView numberOfRowsInSection:0];
147+
if (rows > 0) {
148+
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:rows - 1 inSection:0]
149+
atScrollPosition:UITableViewScrollPositionBottom
150+
animated:animated];
151+
}
152+
}
153+
142154
#pragma mark - Getters
143155

144156
- (LCCKChatBar *)chatBar {

ChatKit/Class/Module/Conversation/Model/AVIMConversation+LCCKExtension.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,13 @@ - (NSString *)lcck_displayName {
116116
}
117117
if (self.members.count == 0) {
118118
return LCCKLocalizedStrings(@"SystemConversation");
119+
} else if (self.members.count > 2) {
120+
return LCCKLocalizedStrings(@"GroupConversation");
121+
} else if (self.members.count == 2) {
122+
return LCCKLocalizedStrings(@"SingleConversation");
123+
} else {
124+
return LCCKLocalizedStrings(@"");
119125
}
120-
return LCCKLocalizedStrings(@"GroupConversation");
121-
122126
}
123127

124128
- (NSString *)lcck_peerId {

ChatKit/Class/Module/Conversation/Model/LCCKConversationViewModel.m

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,20 @@ - (void)sendMessage:(id)aMessage
595595
}
596596

597597
- (void)sendLocalFeedbackTextMessge:(NSString *)localFeedbackTextMessge {
598-
LCCKMessage *localFeedbackMessge = [LCCKMessage localFeedbackText:localFeedbackTextMessge];
599-
[self appendMessagesToDataArrayTrailing:@[localFeedbackMessge]];
600-
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.dataArray.count - 1 inSection:0];
601-
dispatch_async(dispatch_get_main_queue(),^{
598+
void (^operation)(void) = ^(void) {
599+
LCCKMessage *localFeedbackMessge = [LCCKMessage localFeedbackText:localFeedbackTextMessge];
600+
[self appendMessagesToDataArrayTrailing:@[localFeedbackMessge]];
601+
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.dataArray.count - 1 inSection:0];
602602
[self.parentConversationViewController.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
603-
[self.parentConversationViewController scrollToBottomAnimated:YES];
604-
});
603+
[self.parentConversationViewController newScrollToBottomAnimated:YES];
604+
};
605+
if ([NSThread isMainThread]) {
606+
operation();
607+
} else {
608+
dispatch_async(dispatch_get_main_queue(),^{
609+
operation();
610+
});
611+
}
605612
}
606613

607614
- (void)resendMessageForMessageCell:(LCCKChatMessageCell *)messageCell {
@@ -720,15 +727,16 @@ - (void)preloadMessageToTableView:(id)aMessage callback:(LCCKVoidBlock)callback
720727
[indexPaths addObject:indexPath];
721728
}
722729
}
723-
if (NSThread.isMainThread) {
730+
void(^operation)(void) = ^(void) {
724731
[self.parentConversationViewController.tableView insertRowsAtIndexPaths:[indexPaths copy] withRowAnimation:UITableViewRowAnimationNone];
725-
[self.parentConversationViewController scrollToBottomAnimated:YES];
732+
[self.parentConversationViewController newScrollToBottomAnimated:YES];
726733
!callback ?: callback();
734+
};
735+
if (NSThread.isMainThread) {
736+
operation();
727737
} else {
728738
dispatch_async(dispatch_get_main_queue(), ^{
729-
[self.parentConversationViewController.tableView insertRowsAtIndexPaths:[indexPaths copy] withRowAnimation:UITableViewRowAnimationNone];
730-
[self.parentConversationViewController scrollToBottomAnimated:YES];
731-
!callback ?: callback();
739+
operation();
732740
});
733741
}
734742
}

0 commit comments

Comments
 (0)