@@ -46,8 +46,6 @@ public class EMChatManagerWrapper extends EMWrapper implements MethodCallHandler
4646 }
4747
4848
49-
50-
5149 @ Override
5250 public void onMethodCall (MethodCall call , Result result ) {
5351 JSONObject param = (JSONObject ) call .arguments ;
@@ -239,6 +237,7 @@ private void ackGroupMessageRead(JSONObject param, String channelName, Result re
239237 asyncRunnable (()->{
240238 try {
241239 EMClient .getInstance ().chatManager ().ackGroupMessageRead (to , msgId , finalContent );
240+ onSuccess (result , channelName , true );
242241 } catch (HyphenateException e ) {
243242 onError (result , e );
244243 }
@@ -436,6 +435,10 @@ public void onError(int code, String desc) {
436435 }
437436
438437 private void loadAllConversations (JSONObject param , String channelName , Result result ) throws JSONException {
438+ if (EMClient .getInstance ().getCurrentUser () == null || EMClient .getInstance ().getCurrentUser ().length () == 0 ) {
439+ onSuccess (result , channelName , new ArrayList <>());
440+ return ;
441+ }
439442 List <EMConversation > list = new ArrayList <>(EMClient .getInstance ().chatManager ().getAllConversations ().values ());
440443 asyncRunnable (() -> {
441444 boolean retry = false ;
@@ -536,12 +539,12 @@ private void fetchHistoryMessages(JSONObject param, String channelName, Result r
536539
537540 private void searchChatMsgFromDB (JSONObject param , String channelName , Result result ) throws JSONException {
538541 String keywords = param .getString ("keywords" );
539- long timeStamp = param .getLong ("timeStamp " );
542+ long timestamp = param .getLong ("timestamp " );
540543 int count = param .getInt ("maxCount" );
541544 String from = param .getString ("from" );
542545 EMSearchDirection direction = searchDirectionFromString (param .getString ("direction" ));
543546 asyncRunnable (() -> {
544- List <EMMessage > msgList = EMClient .getInstance ().chatManager ().searchMsgFromDB (keywords , timeStamp , count ,
547+ List <EMMessage > msgList = EMClient .getInstance ().chatManager ().searchMsgFromDB (keywords , timestamp , count ,
545548 from , direction );
546549 List <Map > messages = new ArrayList <>();
547550 for (EMMessage msg : msgList ) {
0 commit comments