feat(channel): add getChannelHistoryMessages binding
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -100,4 +100,14 @@ public class ChannelManager extends BaseManager {
|
|||||||
jsonValue(methodCall, "userIDs")
|
jsonValue(methodCall, "userIDs")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getChannelHistoryMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getChannelHistoryMessages(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "channelID"),
|
||||||
|
value(methodCall, "count"),
|
||||||
|
int2long(methodCall, "sinceSeq")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ public class ChannelManager: BaseServiceManager {
|
|||||||
|
|
||||||
|
|
||||||
self["getUsersInChannel"] = getUsersInChannel
|
self["getUsersInChannel"] = getUsersInChannel
|
||||||
|
self["getChannelHistoryMessages"] = getChannelHistoryMessages
|
||||||
self["isJoinChannel"] = isJoinChannel
|
self["isJoinChannel"] = isJoinChannel
|
||||||
self["joinChannel"] = joinChannel
|
self["joinChannel"] = joinChannel
|
||||||
self["quitChannel"] = quitChannel
|
self["quitChannel"] = quitChannel
|
||||||
@@ -50,6 +51,10 @@ public class ChannelManager: BaseServiceManager {
|
|||||||
methodCall[jsonString: "userIDs"])
|
methodCall[jsonString: "userIDs"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getChannelHistoryMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetChannelHistoryMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "channelID"], methodCall[int: "count"], methodCall[int64: "sinceSeq"])
|
||||||
|
}
|
||||||
|
|
||||||
func isJoinChannel(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func isJoinChannel(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkIsJoinChannel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "channelID"])
|
Open_im_sdkIsJoinChannel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "channelID"])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -309,6 +309,25 @@ class ChannelManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
/// Get channel short-term history messages
|
||||||
|
/// [channelID] Channel ID
|
||||||
|
/// [count] Number of messages to retrieve
|
||||||
|
/// [sinceSeq] Internal sequence cursor for pagination (0 for first page)
|
||||||
|
Future<dynamic> getChannelHistoryMessages({
|
||||||
|
required String channelID,
|
||||||
|
int count = 20,
|
||||||
|
int sinceSeq = 0,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'getChannelHistoryMessages',
|
||||||
|
_buildParam({
|
||||||
|
'channelID': channelID,
|
||||||
|
'count': count,
|
||||||
|
'sinceSeq': sinceSeq,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
static Map _buildParam(Map<String, dynamic> param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "channelManager";
|
param["ManagerName"] = "channelManager";
|
||||||
param = Utils.cleanMap(param);
|
param = Utils.cleanMap(param);
|
||||||
|
|||||||
Reference in New Issue
Block a user