@@ -311,7 +311,8 @@ public void createSendMessage(ReadableMap map, Callback callback) {
311311 File file = new File (path );
312312 MediaPlayer mediaPlayer = MediaPlayer .create (mContext , Uri .parse (path ));
313313 int duration = mediaPlayer .getDuration () / 1000 ; // Millisecond to second.
314- content = new VoiceContent (file , duration );
314+ content = new VoiceContent (file ,
315+ duration );
315316 mediaPlayer .release ();
316317 } else if (type .equals (Constant .LOCATION )) {
317318 double latitude = map .getDouble (Constant .LATITUDE );
@@ -1527,14 +1528,14 @@ public void gotResult(int status, String desc, List<ChatRoomInfo> list) {
15271528
15281529 /**
15291530 * 获取聊天室拥有者 UserInfo
1530- * @param roomId 聊天室 id
1531+ * @param map 包含聊天室 id
15311532 * @param success 成功回调
15321533 * @param fail 失败回调
15331534 */
15341535 @ ReactMethod
1535- public void getChatRoomOwner (String roomId , final Callback success , final Callback fail ) {
1536+ public void getChatRoomOwner (ReadableMap map , final Callback success , final Callback fail ) {
15361537 try {
1537- long id = Long .parseLong (roomId );
1538+ long id = Long .parseLong (map . getString ( Constant . ROOM_ID ) );
15381539 Set <Long > set = new HashSet <>();
15391540 set .add (id );
15401541 ChatRoomManager .getChatRoomInfos (set , new RequestCallback <List <ChatRoomInfo >>() {
@@ -1556,13 +1557,13 @@ public void gotResult(int status, String desc, UserInfo userInfo) {
15561557
15571558 /**
15581559 * 进入聊天室,进入后才能收到聊天室信息及发言
1559- * @param roomId 聊天室 id
1560+ * @param map 包含聊天室 id
15601561 * @param success 成功回调
15611562 * @param fail 失败回调
15621563 */
15631564 @ ReactMethod
1564- public void enterChatRoom (String roomId , final Callback success , final Callback fail ) {
1565- ChatRoomManager .enterChatRoom (Long .parseLong (roomId ), new RequestCallback <Conversation >() {
1565+ public void enterChatRoom (ReadableMap map , final Callback success , final Callback fail ) {
1566+ ChatRoomManager .enterChatRoom (Long .parseLong (map . getString ( Constant . ROOM_ID ) ), new RequestCallback <Conversation >() {
15661567 @ Override
15671568 public void gotResult (int status , String desc , Conversation conversation ) {
15681569 mJMessageUtils .handleCallbackWithObject (status , desc , success , fail , ResultUtils .toJSObject (conversation ));
@@ -1572,13 +1573,13 @@ public void gotResult(int status, String desc, Conversation conversation) {
15721573
15731574 /**
15741575 * 离开聊天室
1575- * @param roomId 聊天室 id
1576+ * @param map 包含聊天室 id
15761577 * @param success 成功回调
15771578 * @param fail 失败回调
15781579 */
15791580 @ ReactMethod
1580- public void leaveChatRoom (String roomId , final Callback success , final Callback fail ) {
1581- ChatRoomManager .leaveChatRoom (Long .parseLong (roomId ), new BasicCallback () {
1581+ public void leaveChatRoom (ReadableMap map , final Callback success , final Callback fail ) {
1582+ ChatRoomManager .leaveChatRoom (Long .parseLong (map . getString ( Constant . ROOM_ID ) ), new BasicCallback () {
15821583 @ Override
15831584 public void gotResult (int i , String s ) {
15841585 mJMessageUtils .handleCallback (i , s , success , fail );
0 commit comments