Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
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
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "WordPressKit",
url: "https://github.com/user-attachments/files/20175119/WordPressKit.zip",
checksum: "13aa0e5952616a2f01a0f0db370ee7925d58253c2aab6e216671e8a013ab471b"
url: "https://github.com/user-attachments/files/20825728/WordPressKit.zip",
checksum: "097a2e55e4ec66b4d8c37bc49181df33c4b62ea9d130fac4de057a0867b68a69"
),
]
)
27 changes: 18 additions & 9 deletions Sources/WordPressKit/Services/ActivityServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
///
/// - Returns: An array of activities and a boolean indicating if there's more activities to fetch.
///
open func getActivityForSite(_ siteID: Int,
offset: Int = 0,
count: Int,
after: Date? = nil,
before: Date? = nil,
group: [String] = [],
success: @escaping (_ activities: [Activity], _ hasMore: Bool) -> Void,
failure: @escaping (Error) -> Void) {

open func getActivityForSite(
_ siteID: Int,
offset: Int = 0,
count: Int,
after: Date? = nil,
before: Date? = nil,
group: [String] = [],
rewindable: Bool? = nil,
searchText: String? = nil,
success: @escaping (_ activities: [Activity], _ hasMore: Bool) -> Void,
failure: @escaping (Error) -> Void
) {
var path = URLComponents(string: "sites/\(siteID)/activity")
if rewindable == true, let currentPath = path?.path {
path?.path = currentPath.appending("/rewindable")
}

path?.queryItems = group.map { URLQueryItem(name: "group[]", value: $0) }

Expand All @@ -51,6 +57,9 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
} else if let on = after ?? before {
path?.queryItems?.append(URLQueryItem(name: "on", value: formatter.string(from: on)))
}
if let searchText, !searchText.isEmpty {
path?.queryItems?.append(URLQueryItem(name: "text_search", value: searchText))
}

guard let endpoint = path?.string else {
return
Expand Down