Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let package = Package(
.package(url: "https://github.com/wordpress-mobile/MediaEditor-iOS", branch: "task/spm-support"),
.package(url: "https://github.com/wordpress-mobile/NSObject-SafeExpectations", from: "0.0.6"),
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", branch: "trunk"),
.package(url: "https://github.com/wordpress-mobile/WordPressKit-iOS", branch: "wpios-edition"),
.package(url: "https://github.com/wordpress-mobile/WordPressKit-iOS", branch: "task/add-remote-comment-update-comment"),
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
// We can't use wordpress-rs branches nor commits here. Only tags work.
.package(url: "https://github.com/Automattic/wordpress-rs", revision: "alpha-20250127"),
Expand Down
6 changes: 3 additions & 3 deletions WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions WordPress/Classes/Extensions/Comment+Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,20 @@ extension Comment {
}
}
}

// MARK: Helpers

/// Returns an associated site ID.
///
/// - note: The `Comment` class can be used in two different contexts:
/// Reader and Site, and this property works accordingly.
var associatedSiteID: NSNumber? {
if let post = post as? ReaderPost {
return post.siteID
} else if let blogID = blog?.dotComID {
return blogID
} else {
return nil
}
}
}
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/CommentService.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extern NSUInteger const WPTopLevelHierarchicalCommentsPerPage;
- (void)updateCommentWithID:(NSNumber *)commentID
siteID:(NSNumber *)siteID
content:(NSString *)content
success:(void (^ _Nullable)(void))success
success:(void (^ _Nullable)(RemoteComment * _Nullable comment))success
failure:(void (^ _Nullable)(NSError * _Nullable error))failure;

// Replies
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Services/CommentService.m
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ - (NSString *)sanitizeCommentContent:(NSString *)string isPrivateSite:(BOOL)isPr
- (void)updateCommentWithID:(NSNumber *)commentID
siteID:(NSNumber *)siteID
content:(NSString *)content
success:(void (^)(void))success
success:(void (^)(RemoteComment *comment))success
failure:(void (^)(NSError *error))failure
{
CommentServiceRemoteREST *remote = [self restRemoteForSite:siteID];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class NotificationActionsService: CoreDataService {
block.textOverride = content

// Hit the backend
commentService.updateComment(withID: commentID, siteID: siteID, content: content, success: {
commentService.updateComment(withID: commentID, siteID: siteID, content: content, success: { _ in
DDLogInfo("Successfully updated to comment \(siteID).\(commentID)")
self.invalidateCacheAndForceSyncNotification(with: block)
completion?(true)
Expand Down
10 changes: 9 additions & 1 deletion WordPress/Classes/Stores/NoticeStore.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import WordPressFlux
import WordPressShared

/// Notice represents a small notification that that can be displayed within
/// the app, much like Android toasts or snackbars.
Expand Down Expand Up @@ -65,7 +66,6 @@ struct Notice {
self.actionHandler = actionHandler
self.style = style
}

}

extension Notice: Equatable {
Expand All @@ -75,6 +75,14 @@ extension Notice: Equatable {
}

extension Notice {
/// Creates a notice with a localized description of the given error.
init(error: Error, title: String? = nil) {
self.init(
title: title ?? SharedStrings.Error.generic,
message: error.localizedDescription.stringByDecodingXMLCharacters()
)
}

func post() {
ActionDispatcher.dispatch(NoticeAction.post(self))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,13 +982,10 @@ private extension CommentDetailViewController {
}

@objc func buttonAddCommentTapped() {
guard let viewModel = CommentComposerViewModel(comment: comment) else {
return wpAssertionFailure("missing required parameters")
}
viewModel.save = { [weak self] in
let viewModel = CommentCreateViewModel(replyingTo: comment) { [weak self] in
try await self?.createReply(content: $0)
}
let composerVC = CommentComposerViewController(viewModel: viewModel)
let composerVC = CommentCreateViewController(viewModel: viewModel)
let navigationVC = UINavigationController(rootViewController: composerVC)
present(navigationVC, animated: true)
}
Expand Down

This file was deleted.

Loading