@@ -27,16 +27,22 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
2727 ///
2828 /// - Returns: An array of activities and a boolean indicating if there's more activities to fetch.
2929 ///
30- open func getActivityForSite( _ siteID: Int ,
31- offset: Int = 0 ,
32- count: Int ,
33- after: Date ? = nil ,
34- before: Date ? = nil ,
35- group: [ String ] = [ ] ,
36- success: @escaping ( _ activities: [ Activity ] , _ hasMore: Bool ) -> Void ,
37- failure: @escaping ( Error ) -> Void ) {
38-
30+ open func getActivityForSite(
31+ _ siteID: Int ,
32+ offset: Int = 0 ,
33+ count: Int ,
34+ after: Date ? = nil ,
35+ before: Date ? = nil ,
36+ group: [ String ] = [ ] ,
37+ rewindable: Bool ? = nil ,
38+ searchText: String ? = nil ,
39+ success: @escaping ( _ activities: [ Activity ] , _ hasMore: Bool ) -> Void ,
40+ failure: @escaping ( Error ) -> Void
41+ ) {
3942 var path = URLComponents ( string: " sites/ \( siteID) /activity " )
43+ if rewindable == true , let currentPath = path? . path {
44+ path? . path = currentPath. appending ( " /rewindable " )
45+ }
4046
4147 path? . queryItems = group. map { URLQueryItem ( name: " group[] " , value: $0) }
4248
@@ -51,6 +57,9 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
5157 } else if let on = after ?? before {
5258 path? . queryItems? . append ( URLQueryItem ( name: " on " , value: formatter. string ( from: on) ) )
5359 }
60+ if let searchText, !searchText. isEmpty {
61+ path? . queryItems? . append ( URLQueryItem ( name: " text_search " , value: searchText) )
62+ }
5463
5564 guard let endpoint = path? . string else {
5665 return
0 commit comments