Skip to content

Commit

Permalink
Merge pull request #1971 from nextcloud/chore/noid/objc-swift-cleanup
Browse files Browse the repository at this point in the history
chore: Remove legacy ChatTableViewCell
  • Loading branch information
Ivansss authored Feb 12, 2025
2 parents 8e75cd6 + d4a8b5e commit 4d27531
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 230 deletions.
6 changes: 0 additions & 6 deletions NextcloudTalk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@
2CC32E9A27F5DADB00BB8C39 /* NCChatReaction.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC32E9727F5D9BD00BB8C39 /* NCChatReaction.m */; };
2CC7158920B837140045C789 /* PlaceholderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CC7158820B837140045C789 /* PlaceholderView.xib */; };
2CC7158C20B8394A0045C789 /* PlaceholderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC7158B20B8394A0045C789 /* PlaceholderView.m */; };
2CC7159420C54D080045C789 /* ChatTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC7159320C54D080045C789 /* ChatTableViewCell.m */; };
2CCCD21D2835088F00F076CE /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 2CCCD21C2835088F00F076CE /* OpenSSL */; };
2CD4F6B72C11C80600ED594F /* ContactsSearchResultTableViewContoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD4F6B62C11C80600ED594F /* ContactsSearchResultTableViewContoller.swift */; };
2CD5F3242142781A006B71BF /* NCExternalSignalingController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CD5F3232142781A006B71BF /* NCExternalSignalingController.m */; };
Expand Down Expand Up @@ -1172,8 +1171,6 @@
2CC7158820B837140045C789 /* PlaceholderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PlaceholderView.xib; sourceTree = "<group>"; };
2CC7158A20B8394A0045C789 /* PlaceholderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlaceholderView.h; sourceTree = "<group>"; };
2CC7158B20B8394A0045C789 /* PlaceholderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PlaceholderView.m; sourceTree = "<group>"; };
2CC7159220C54D080045C789 /* ChatTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatTableViewCell.h; sourceTree = "<group>"; };
2CC7159320C54D080045C789 /* ChatTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatTableViewCell.m; sourceTree = "<group>"; };
2CD4F6B62C11C80600ED594F /* ContactsSearchResultTableViewContoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsSearchResultTableViewContoller.swift; sourceTree = "<group>"; };
2CD5F3222142781A006B71BF /* NCExternalSignalingController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCExternalSignalingController.h; sourceTree = "<group>"; };
2CD5F3232142781A006B71BF /* NCExternalSignalingController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCExternalSignalingController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1951,8 +1948,6 @@
2C04248F2CA32D45004772F6 /* BaseChatTableViewCell+Audio.swift */,
2C4747E52CB6710F002828F2 /* BaseChatTableViewCell+Poll.swift */,
1FE029B92CE289A200C0C633 /* MessageSeparatorTableViewCell.swift */,
2CC7159220C54D080045C789 /* ChatTableViewCell.h */,
2CC7159320C54D080045C789 /* ChatTableViewCell.m */,
1F35F9022AEEDEE800044BDA /* AutoCompletionTableViewCell.h */,
1F35F9032AEEDF0E00044BDA /* AutoCompletionTableViewCell.m */,
2C604BD7211988A700D34DCD /* SystemMessageTableViewCell.h */,
Expand Down Expand Up @@ -2962,7 +2957,6 @@
2CC32E9227F45AE000BB8C39 /* ReactionsViewCell.swift in Sources */,
1F1B0F452BE047CE003FD766 /* ModalPresentationController.swift in Sources */,
2CBF82AE1FC888FC00636459 /* NCPushNotification.m in Sources */,
2CC7159420C54D080045C789 /* ChatTableViewCell.m in Sources */,
1F8AAC322C518759004DA20A /* SignalingSettings.swift in Sources */,
1F1B0F272BDA61C5003FD766 /* AllocationTracker.swift in Sources */,
2CA1CCAA1F02D1A4002FE6A2 /* NCAPIController.m in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions NextcloudTalk/AutoCompletionTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

#import <UIKit/UIKit.h>

#import "SystemMessageTableViewCell.h"

static CGFloat kAutoCompletionCellHeight = 50.0;

static NSString *AutoCompletionCellIdentifier = @"AutoCompletionCellIdentifier";

@class AvatarButton;
Expand Down
1 change: 0 additions & 1 deletion NextcloudTalk/AutoCompletionTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

#import "AutoCompletionTableViewCell.h"
#import "ChatTableViewCell.h"

#import "SLKUIConstants.h"

Expand Down
11 changes: 0 additions & 11 deletions NextcloudTalk/BaseChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3041,17 +3041,6 @@ import SwiftUI

let cell = tableView.cellForRow(at: indexPath)

// Show reactionSummary for legacy cells
if let cell = cell as? ChatTableViewCell {
let pointInCell = tableView.convert(point, to: cell)
let reactionView = cell.contentView.subviews.first(where: { $0 is ReactionsView && $0.frame.contains(pointInCell) })

if reactionView != nil {
self.showReactionsSummary(of: cell.message)
return nil
}
}

if let cell = cell as? BaseChatTableViewCell {
let pointInCell = tableView.convert(point, to: cell)
let pointInReactionPart = cell.convert(pointInCell, to: cell.reactionPart)
Expand Down
39 changes: 0 additions & 39 deletions NextcloudTalk/ChatTableViewCell.h

This file was deleted.

158 changes: 0 additions & 158 deletions NextcloudTalk/ChatTableViewCell.m

This file was deleted.

11 changes: 0 additions & 11 deletions NextcloudTalk/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1781,17 +1781,6 @@ import SwiftyAttributes

let cell = tableView.cellForRow(at: indexPath)

// Show reactionSummary for legacy cells
if let cell = cell as? ChatTableViewCell {
let pointInCell = tableView.convert(point, to: cell)
let reactionView = cell.contentView.subviews.first(where: { $0 is ReactionsView && $0.frame.contains(pointInCell) })

if reactionView != nil {
self.showReactionsSummary(of: cell.message)
return nil
}
}

if let cell = cell as? BaseChatTableViewCell {
let pointInCell = tableView.convert(point, to: cell)
let pointInReactionPart = cell.convert(pointInCell, to: cell.reactionPart)
Expand Down
4 changes: 3 additions & 1 deletion NextcloudTalk/MessageSeparatorTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ protocol MessageSeparatorTableViewCellDelegate: AnyObject {
func generateSummaryButtonPressed()
}

class MessageSeparatorTableViewCell: ChatTableViewCell {
class MessageSeparatorTableViewCell: UITableViewCell {

public weak var delegate: MessageSeparatorTableViewCellDelegate?

public var messageId: Int = 0

public static let identifier = "MessageSeparatorCellIdentifier"

public static let unreadMessagesSeparatorId = -99
Expand Down
9 changes: 9 additions & 0 deletions NextcloudTalk/NCChatMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ extern NSString * const kSharedItemTypeVoice;
extern NSString * const kSharedItemTypePoll;
extern NSString * const kSharedItemTypeRecording;

typedef NS_ENUM(NSInteger, ChatMessageDeliveryState) {
ChatMessageDeliveryStateSent = 0,
ChatMessageDeliveryStateRead,
ChatMessageDeliveryStateSending,
ChatMessageDeliveryStateDeleting,
ChatMessageDeliveryStateFailed,
ChatMessageDeliveryStateSilent
};

@class NCChatMessage;

typedef void (^GetReferenceDataCompletionBlock)(NCChatMessage *message, NSDictionary *referenceData, NSString *url);
Expand Down
2 changes: 2 additions & 0 deletions NextcloudTalk/NextcloudTalk-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,6 @@
#import "AvatarBackgroundImageView.h"
#import "NCUser.h"

#import "DRCellSlideGestureRecognizer.h"

#endif /* NextcloudTalk_Bridging_Header_h */
8 changes: 5 additions & 3 deletions NextcloudTalk/SystemMessageTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@

#import <UIKit/UIKit.h>

#import "ChatTableViewCell.h"
#import "MessageBodyTextView.h"
#import "NCChatMessage.h"

static CGFloat kChatCellAvatarHeight = 30.0;
static CGFloat kSystemMessageCellMinimumHeight = 30.0;

static NSString *SystemMessageCellIdentifier = @"SystemMessageCellIdentifier";

@protocol SystemMessageTableViewCellDelegate <ChatTableViewCellDelegate>
@protocol SystemMessageTableViewCellDelegate <NSObject>

- (void)cellWantsToCollapseMessagesWithMessage:(NCChatMessage *)message;

@end

@interface SystemMessageTableViewCell : ChatTableViewCell
@interface SystemMessageTableViewCell : UITableViewCell

@property (nonatomic, weak) id<SystemMessageTableViewCellDelegate> delegate;

@property (nonatomic, assign) NSInteger messageId;
@property (nonatomic, strong) NCChatMessage *message;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) MessageBodyTextView *bodyTextView;
@property (nonatomic, strong) UIButton *collapseButton;
Expand Down
2 changes: 2 additions & 0 deletions NextcloudTalk/SystemMessageTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#import "NextcloudTalk-Swift.h"

static CGFloat kChatCellDateLabelWidth = 40.0;

@interface SystemMessageTableViewCell () <UITextFieldDelegate>
@property (nonatomic, assign) BOOL didCreateSubviews;
@end
Expand Down

0 comments on commit 4d27531

Please sign in to comment.