@@ -1301,6 +1301,58 @@ extension WebAPI {
13011301 failure ? ( error)
13021302 }
13031303 }
1304+
1305+ public func conversationsMembers(
1306+ id: String ,
1307+ cursor: String ? = nil ,
1308+ limit: Int ? = nil ,
1309+ success: ( ( _ members: [ String ] ? , _ nextCursor: String ? ) -> Void ) ? ,
1310+ failure: FailureClosure ?
1311+ ) {
1312+ var parameters : [ String : Any ] = [
1313+ " token " : token,
1314+ " channel " : id
1315+ ]
1316+ if let cursor = cursor {
1317+ parameters [ " cursor " ] = cursor
1318+ }
1319+ if let limit = limit {
1320+ parameters [ " limit " ] = limit
1321+ }
1322+ networkInterface. request ( . conversationsMembers, parameters: parameters, successClosure: { ( response) in
1323+ success ? ( response [ " members " ] as? [ String ] , ( response [ " response_metadata " ] as? [ String : Any ] ) ? [ " next_cursor " ] as? String )
1324+ } ) { ( error) in
1325+ failure ? ( error)
1326+ }
1327+ }
1328+
1329+ public func conversationsHistory(
1330+ id: String ,
1331+ cursor: String ? = nil ,
1332+ inclusive: Bool = false ,
1333+ latest: String = " \( Date ( ) . timeIntervalSince1970) " ,
1334+ limit: Int = 10 ,
1335+ oldest: String = " 0 " ,
1336+ success: ( ( _ channels: [ [ String : Any ] ] ? , _ nextCursor: String ? ) -> Void ) ? ,
1337+ failure: FailureClosure ?
1338+ ) {
1339+ var parameters : [ String : Any ] = [
1340+ " token " : token,
1341+ " channel " : id,
1342+ " inclusive " : inclusive,
1343+ " limit " : limit,
1344+ " latest " : latest,
1345+ " oldest " : oldest,
1346+ ]
1347+ if let cursor = cursor {
1348+ parameters [ " cursor " ] = cursor
1349+ }
1350+ networkInterface. request ( . conversationsHistory, parameters: parameters, successClosure: { ( response) in
1351+ success ? ( response [ " messages " ] as? [ [ String : Any ] ] , ( response [ " response_metadata " ] as? [ String : Any ] ) ? [ " next_cursor " ] as? String )
1352+ } ) { ( error) in
1353+ failure ? ( error)
1354+ }
1355+ }
13041356}
13051357
13061358// MARK: - Search
0 commit comments