File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -528,7 +528,7 @@ - (void)doCommentToComment:(TaskComment *)toComment sender:(id)sender{
528528 _myMsgInputView.toUser = toComment.owner ;
529529
530530 if (_toComment) {
531- if ([_toComment.owner.global_key isEqualToString: [Login curLoginUser ] .global_key]) {
531+ if ([Login isLoginUserGlobalKey: _toComment.owner.global_key]) {
532532 __weak typeof (self) weakSelf = self;
533533 UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此评论" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
534534 if (index == 0 ) {
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButto
266266}
267267- (BOOL )tableView : (UITableView *)tableView canEditRowAtIndexPath : (NSIndexPath *)indexPath {
268268 BOOL canEdit = NO ;
269- if (self.type == ProMemTypeProject && [Login isOwnerOfProjectWithOwnerId :self .myProject.owner_id ]) {
269+ if (self.type == ProMemTypeProject && [Login isLoginUserGlobalKey :self .myProject.owner_user_name ]) {
270270 ProjectMember *curMember;
271271 if (tableView == _mySearchDisplayController.searchResultsTableView ) {
272272 curMember = [_searchResults objectAtIndex: indexPath.row];
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
335335 weakSelf.commentToUser = ((Comment*)[weakSelf.commentTweet.comment_list objectAtIndex: weakSelf.commentIndex]).owner ;
336336 weakSelf.myMsgInputView .toUser = ((Comment*)[weakSelf.commentTweet.comment_list objectAtIndex: weakSelf.commentIndex]).owner ;
337337
338- if (weakSelf. commentToUser . id . intValue == [Login curLoginUser ]. id . intValue ) {
338+ if ([Login isLoginUserGlobalKey: weakSelf.commentToUser.global_key] ) {
339339 ESWeakSelf
340340 UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此评论" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
341341 ESStrongSelf
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ - (void)doCommentToTopic:(ProjectTopic *)toComment sender:(id)sender
340340 _myMsgInputView.toUser = toComment.owner ;
341341
342342 if (_toComment) {
343- if (_toComment. owner_id . intValue == [Login curLoginUser ]. id . intValue ) {
343+ if ([Login isLoginUserGlobalKey: _toComment.owner.global_key] ) {
344344 ESWeakSelf
345345 UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此评论" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
346346 ESStrongSelf
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ - (void)doCommentToComment:(Comment *)toComment sender:(id)sender{
325325 _myMsgInputView.toUser = toComment.owner ;
326326
327327 if (_toComment) {
328- if (_toComment. owner_id . intValue == [Login curLoginUser ]. id . intValue ) {
328+ if ([Login isLoginUserGlobalKey: _toComment.owner.global_key] ) {
329329 ESWeakSelf;
330330 UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此评论" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
331331 ESStrongSelf
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
242242
243243 weakSelf.myMsgInputView .toUser = ((Comment*)[weakSelf.commentTweet.comment_list objectAtIndex: weakSelf.commentIndex]).owner ;
244244
245- if (weakSelf. commentToUser . id . intValue == [Login curLoginUser ]. id . intValue ) {
245+ if ([Login isLoginUserGlobalKey: weakSelf.commentToUser.global_key] ) {
246246
247247 UIActionSheet *actionSheet = [UIActionSheet bk_actionSheetCustomWithTitle: @" 删除此评论" buttonTitles: nil destructiveTitle: @" 确认删除" cancelTitle: @" 取消" andDidDismissBlock: ^(UIActionSheet *sheet, NSInteger index) {
248248 if (index == 0 && weakSelf.commentIndex >= 0 ) {
Original file line number Diff line number Diff line change 2424+ (User *)curLoginUser ;
2525+ (void )addUmengAliasWithCurUser : (BOOL )add ;
2626+ (void )setXGAccountWithCurUser ;
27- + (BOOL )isOwnerOfProjectWithOwnerId : (NSNumber *)owner_id ;
2827+ (User *)userWithGlobaykeyOrEmail : (NSString *)textStr ;
2928+ (NSMutableDictionary *)readLoginDataList ;
29+ +(BOOL )isLoginUserGlobalKey : (NSString *)global_key ;
3030@end
Original file line number Diff line number Diff line change @@ -182,12 +182,11 @@ + (User *)curLoginUser{
182182 }
183183 return curLoginUser;
184184}
185- + (BOOL )isOwnerOfProjectWithOwnerId : (NSNumber *)owner_id {
186- User *curLoginUser = [Login curLoginUser ];
187- if (curLoginUser) {
188- return (curLoginUser.id .integerValue == owner_id.integerValue );
189- }else {
185+
186+ +(BOOL )isLoginUserGlobalKey : (NSString *)global_key {
187+ if (global_key.length <= 0 ) {
190188 return NO ;
191189 }
190+ return [[self curLoginUser ].global_key isEqualToString: global_key];
192191}
193192@end
Original file line number Diff line number Diff line change @@ -163,8 +163,8 @@ - (NSString *)toDeletePath
163163
164164- (BOOL )canEdit
165165{
166- return (self. owner_id . integerValue == [Login curLoginUser ]. id . integerValue // 讨论创建者
167- || [Login isOwnerOfProjectWithOwnerId :self .project.owner_id ]); // 项目创建者
166+ return ([Login isLoginUserGlobalKey: self .owner.global_key] || // 讨论创建者
167+ [Login isLoginUserGlobalKey :self .project.owner_user_name ]);// 项目创建者
168168}
169169
170170@end
Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ - (NSDictionary *)toParams{
5858 case TweetTypeUserFriends:
5959 break ;
6060 case TweetTypeUserSingle:
61- if (_curUser && _curUser.id ) {
62- [params setObject: _curUser.id forKey: @" user_id " ];
61+ if (_curUser && _curUser.global_key ) {
62+ [params setObject: _curUser.global_key forKey: @" global_key " ];
6363 }else if ([Login curLoginUser ].id ) {
64- [params setObject: [Login curLoginUser ].id forKey: @" user_id " ];
64+ [params setObject: [Login curLoginUser ].global_key forKey: @" global_key " ];
6565 }
6666 break ;
6767 default :
You can’t perform that action at this time.
0 commit comments