-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathDemotionExample.java
More file actions
48 lines (38 loc) · 1.44 KB
/
DemotionExample.java
File metadata and controls
48 lines (38 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package io.rong.example.chatroom;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.chatroom.demotion.Demotion;
import io.rong.models.response.ChatroomDemotionMsgResult;
import io.rong.models.response.ResponseResult;
public class DemotionExample {
/**
* Replace with your appKey
*/
private static final String appKey = "appKey";
/**
* Replace with your appSecret
*/
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
Demotion demotion = rongCloud.chatroom.demotion;
/**
*
* Add in-app chatroom message demotion
*/
String[] messageType = {"RC:VcMsg", "RC:ImgTextMsg", "RC:ImgMsg"};
ResponseResult addResult = demotion.add(messageType);
System.out.println("add demotion: " + addResult.toString());
/**
*
* Remove in-app chatroom message demotion
*/
ResponseResult removeResult = demotion.remove(messageType);
System.out.println("remove demotion: " + removeResult.toString());
/**
* Retrieves the list of demotion messages and prints the result.
*/
ChatroomDemotionMsgResult demotionMsgResult = demotion.getList();
System.out.println("get demotion: " + demotionMsgResult.toString());
}
}