|
@@ -178,12 +178,22 @@
|
|
|
- (void)viewWillDisappear:(BOOL)animated {
|
|
|
[super viewWillDisappear:animated];
|
|
|
[self saveChatData];
|
|
|
+ [self setRecordStates];
|
|
|
}
|
|
|
|
|
|
- (void)backBarButtonPressed:(id)pressed {
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
}
|
|
|
|
|
|
+//设置已读
|
|
|
+- (void)setRecordStates {
|
|
|
+ [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Chat/SetRecordStates" parameter:@{@"friendId" : self.friendModel.userId} success:^(id responseObject) {
|
|
|
+
|
|
|
+ } failure:^(SPRequestError *error) {
|
|
|
+
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
- (void)saveChatData {
|
|
|
NSString *key = [NSString stringWithFormat:@"%@--to--%@",[SLGlobalInfo SharedInstance].loginInfo.user.userId, self.friendModel.userId];
|
|
|
NSArray *dictArr = [NSObject mj_keyValuesArrayWithObjectArray:self.chatServiceView.messageView.chatDataManager];
|