Commit d3fc5b6d authored by Dominic Vedericho's avatar Dominic Vedericho
Browse files

Merge branch 'release/1.0.16'

parents 63f95f88 4c0d2b5b
......@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "TapTalk"
s.version = "1.0.15"
s.version = "1.0.16"
s.summary = "TapTalk.io is a complete in-app chat SDK and messaging API. Its in-app chat feature give you and your user the best in-app chat experience, it provides you with UI Based implementation and code based implementation and fully customizable."
s.homepage = "https://taptalk.io"
......
No preview for this file type
......@@ -10,12 +10,8 @@
#import "TAPFileDownloadManager.h"
#import "TAPDataManager.h"
//#define kExecuteCountdown 7*24*60*60*1000.0f //7 days in miliseconds
#define kExecuteCountdown 7*24*60*60*1000.0f //7 days in miliseconds
#define kOneMonthTimeIntervalInMilliseconds 30*24*60*60*1000.0f //30 days in miliseconds
#define kExecuteCountdown 1.0f //7 days in miliseconds //RN Temp
//#define kExecuteCountdown 5*60*1000.0f //7 days in miliseconds
//#define kOneMonthTimeIntervalInMilliseconds 5*60*1000.0f //30 days in miliseconds
@interface TAPOldDataManager ()
......
......@@ -35,6 +35,7 @@
#define TAP_PREFS_PROJECT_CONFIGS_DICTIONARY @"Prefs.TapTalkProjectConfigsDictionary"
#define TAP_PREFS_AUTO_SYNC_CONTACT_DISABLED @"Prefs.TapTalkAutoSyncContactDisabled"
#define TAP_PREFS_DONE_FIRST_TIME_AUTO_SYNC_CONTACT @"Prefs.TapTalkDoneFirstTimeAutoSyncContact"
#define TAP_PREFS_IS_CONTACT_SYNC_ALLOWED_BY_USER @"Prefs.TapTalkIsContactSyncAllowedByUser"
#define TAP_PREFS_PENDING_UPDATE_READ_MESSAGE @"Prefs.TapTalkPendingUpdateReadMessage"
//Color
......
......@@ -822,7 +822,15 @@
}];
}
else {
[self showPopupViewWithPopupType:TAPPopUpInfoViewControllerTypeInfoDefault popupIdentifier:@"Contact Access" title:NSLocalizedString(@"Contact Access", @"") detailInformation:NSLocalizedString(@"We need your permission to access your contact, we will sync your contact to our server and automatically find your friend so it is easier for you to find your friends.", @"") leftOptionButtonTitle:@"Cancel" singleOrRightOptionButtonTitle:@"Allow"];
//if already logout
//permission ada, muncul button
// if () {
// }
// else {
[self showPopupViewWithPopupType:TAPPopUpInfoViewControllerTypeInfoDefault popupIdentifier:@"Contact Access" title:NSLocalizedString(@"Contact Access", @"") detailInformation:NSLocalizedString(@"We need your permission to access your contact, we will sync your contact to our server and automatically find your friend so it is easier for you to find your friends.", @"") leftOptionButtonTitle:@"Cancel" singleOrRightOptionButtonTitle:@"Allow"];
// }
}
}
......
......@@ -33,6 +33,9 @@
@property (strong, nonatomic) NSMutableArray *roomListArray;
@property (strong, nonatomic) NSMutableDictionary *roomListDictionary;
@property (nonatomic) NSInteger firstUnreadProcessCount;
@property (nonatomic) NSInteger firstUnreadTotalCount;
@property (nonatomic) BOOL isNeedRefreshOnNetworkDown;
@property (nonatomic) BOOL isShowMyAccountView;
......@@ -48,6 +51,7 @@
- (void)updateCellDataAtIndexPath:(NSIndexPath *)indexPath updateUnreadBubble:(BOOL)updateUnreadBubble;
- (void)openNewChatViewController;
- (void)hideSetupViewWithDelay:(double)delayTime;
- (void)getAndUpdateNumberOfUnreadToDelegate;
@end
......@@ -871,6 +875,9 @@
return;
}
_firstUnreadProcessCount = 0;
_firstUnreadTotalCount = [roomListLocalArray count];
for (TAPRoomListModel *roomList in roomListLocalArray) {
TAPMessageModel *messageData = roomList.lastMessage;
TAPRoomModel *roomData = messageData.room;
......@@ -887,7 +894,13 @@
roomList.numberOfUnreadMessages = 0;
}
_firstUnreadProcessCount++;
dispatch_async(dispatch_get_main_queue(), ^{
if(self.firstUnreadProcessCount >= self.firstUnreadTotalCount) {
[self getAndUpdateNumberOfUnreadToDelegate];
}
NSInteger cellRow = [self.roomListArray indexOfObject:roomList];
NSIndexPath *cellIndexPath = [NSIndexPath indexPathForRow:cellRow inSection:0];
[self updateCellDataAtIndexPath:cellIndexPath updateUnreadBubble:YES];
......@@ -922,6 +935,11 @@
return;
}
if([roomLastMessage.created integerValue] > [message.created integerValue]) {
//Don't process last message, current last message is newer that the incoming one
return;
}
if ([roomLastMessage.localID isEqualToString:message.localID]) {
//Last message is same, just updated, update the data only
roomLastMessage.updated = message.updated;
......@@ -984,8 +1002,9 @@
[self.roomListView.roomListTableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.roomListView.roomListTableView endUpdates];
[self.roomListView showNoChatsView:NO];
}
[self getAndUpdateNumberOfUnreadToDelegate];
}
- (void)updateCellDataAtIndexPath:(NSIndexPath *)indexPath updateUnreadBubble:(BOOL)updateUnreadBubble {
......@@ -1052,4 +1071,24 @@
[self.roomListView.roomListTableView reloadData];
}
- (void)getAndUpdateNumberOfUnreadToDelegate {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
NSInteger unreadRoomCount = 0;
for(TAPRoomListModel *roomList in self.roomListArray) {
if(roomList.numberOfUnreadMessages > 0) {
unreadRoomCount++;
}
}
dispatch_async(dispatch_get_main_queue(), ^{
//Send delegate to be used to client side, update to delegate after check unread database
if ([[TapTalk sharedInstance].delegate respondsToSelector:@selector(tapTalkUnreadChatRoomBadgeCountUpdated:)]) {
[[TapTalk sharedInstance].delegate tapTalkUnreadChatRoomBadgeCountUpdated:unreadRoomCount];
}
});
});
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment