Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc561b846e | ||
|
|
4628b3b0b6 | ||
|
|
9c69fbc7d4 | ||
|
|
9047020d69 | ||
|
|
1c18d862a1 | ||
|
|
b0ddca985a | ||
|
|
996e06c451 | ||
|
|
612747203a | ||
|
|
f7853ae299 | ||
|
|
7443db3078 | ||
|
|
ad5f6cb228 |
@@ -170,6 +170,10 @@ group.allow_robot_custom_operation_notification true
|
|||||||
## 0 不发送,1 退群时发送,2 踢人时发送,3 退群和踢人时都发送。
|
## 0 不发送,1 退群时发送,2 踢人时发送,3 退群和踢人时都发送。
|
||||||
group.visible_quit_or_kickoff_notification 0
|
group.visible_quit_or_kickoff_notification 0
|
||||||
|
|
||||||
|
## 禁止客户端群操作。第1位是禁止创建群组,第2位是禁止销毁群组,3位禁止加入群,4位禁止退出群,5位禁止邀请群成员,6位禁止移出群成员,7位禁止转移群,8位禁止设置群管理员,9位禁止白名单处理,10位禁止群禁言,11位禁止修改群组信息,12位禁止群成员禁言。
|
||||||
|
## Server API不受此限制。
|
||||||
|
#group.forbidden_client_operation 0xFFF
|
||||||
|
|
||||||
## 隐藏用户信息属性类型,2是性别,3是电话号码,4是邮箱,5是地址,6是公司信息,7是社交账号,8是Extra信息。当需要隐藏多个时以英文逗号分开;
|
## 隐藏用户信息属性类型,2是性别,3是电话号码,4是邮箱,5是地址,6是公司信息,7是社交账号,8是Extra信息。当需要隐藏多个时以英文逗号分开;
|
||||||
## 本配置是为了提高安全性,避免把对应信息同步到客户端,这样就能防止程序被破解从而拿到用户关键信息。仅对客户端有效,server api不受影响。
|
## 本配置是为了提高安全性,避免把对应信息同步到客户端,这样就能防止程序被破解从而拿到用户关键信息。仅对客户端有效,server api不受影响。
|
||||||
## 注意,修改本配置不会对已经同步的信息产生影响。
|
## 注意,修改本配置不会对已经同步的信息产生影响。
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>0.99</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>moquette-broker</artifactId>
|
<artifactId>moquette-broker</artifactId>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import io.netty.channel.ChannelHandlerContext;
|
|||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
import io.netty.handler.codec.http.FullHttpRequest;
|
import io.netty.handler.codec.http.FullHttpRequest;
|
||||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||||
|
import io.netty.util.internal.StringUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import win.liyufan.im.Utility;
|
import win.liyufan.im.Utility;
|
||||||
@@ -108,7 +109,7 @@ abstract public class ActionHandler extends SimpleChannelInboundHandler<FullHttp
|
|||||||
* @param response 响应对象
|
* @param response 响应对象
|
||||||
*/
|
*/
|
||||||
private void doAction(ChannelHandlerContext ctx, Request request, Response response){
|
private void doAction(ChannelHandlerContext ctx, Request request, Response response){
|
||||||
if(("/route".equalsIgnoreCase(request.getPath()) || request.getPath().startsWith("/fs/"))
|
if(("/route".equalsIgnoreCase(request.getPath()) || (!StringUtil.isNullOrEmpty(request.getPath()) && request.getPath().startsWith("/fs/")))
|
||||||
&& "OPTIONS".equalsIgnoreCase(request.getMethod())){
|
&& "OPTIONS".equalsIgnoreCase(request.getMethod())){
|
||||||
handleOptions(ctx, request, response);
|
handleOptions(ctx, request, response);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ public final class BrokerConstants {
|
|||||||
public static final String GROUP_Allow_Robot_Custom_Operation_Notification = "group.allow_robot_custom_operation_notificatio";
|
public static final String GROUP_Allow_Robot_Custom_Operation_Notification = "group.allow_robot_custom_operation_notificatio";
|
||||||
|
|
||||||
public static final String GROUP_Visible_Quit_Kickoff_Notification = "group.visible_quit_or_kickoff_notification";
|
public static final String GROUP_Visible_Quit_Kickoff_Notification = "group.visible_quit_or_kickoff_notification";
|
||||||
|
public static final String GROUP_Forbidden_Client_Operation = "group.forbidden_client_operation";
|
||||||
|
|
||||||
public static final String USER_HIDE_PROPERTIES = "user.hide_properties";
|
public static final String USER_HIDE_PROPERTIES = "user.hide_properties";
|
||||||
public static final String USER_KEEP_DISPLAY_NAME_WHEN_DESTROY = "user.keep_display_name_when_destroy";
|
public static final String USER_KEEP_DISPLAY_NAME_WHEN_DESTROY = "user.keep_display_name_when_destroy";
|
||||||
|
|||||||
@@ -24,6 +24,20 @@ public class AddGroupMember extends GroupHandler<WFCMessage.AddGroupMemberReques
|
|||||||
@Override
|
@Override
|
||||||
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.AddGroupMemberRequest request, Qos1PublishHandler.IMCallback callback) {
|
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.AddGroupMemberRequest request, Qos1PublishHandler.IMCallback callback) {
|
||||||
boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;
|
boolean isAdmin = requestSourceType == ProtoConstants.RequestSourceType.Request_From_Admin;
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if(request.getAddedMemberList().size() == 1 && request.getAddedMember(0).getMemberId().equals(fromUser)) {
|
||||||
|
if ((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Join_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Invite_Group_Member) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode errorCode = m_messagesStore.addGroupMembers(fromUser, isAdmin, request.getGroupId(), request.getAddedMemberList(), request.getExtra());
|
ErrorCode errorCode = m_messagesStore.addGroupMembers(fromUser, isAdmin, request.getGroupId(), request.getAddedMemberList(), request.getExtra());
|
||||||
if (errorCode == ERROR_CODE_SUCCESS) {
|
if (errorCode == ERROR_CODE_SUCCESS) {
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import win.liyufan.im.IMTopic;
|
|||||||
public class CreateGroupHandler extends GroupHandler<WFCMessage.CreateGroupRequest> {
|
public class CreateGroupHandler extends GroupHandler<WFCMessage.CreateGroupRequest> {
|
||||||
@Override
|
@Override
|
||||||
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.CreateGroupRequest request, Qos1PublishHandler.IMCallback callback) {
|
public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.CreateGroupRequest request, Qos1PublishHandler.IMCallback callback) {
|
||||||
if(request.getGroup().getGroupInfo().getType() < 0 || request.getGroup().getGroupInfo().getType() > 2) {
|
if(request.getGroup().getGroupInfo().getType() < 0 || request.getGroup().getGroupInfo().getType() > 3) {
|
||||||
return ErrorCode.ERROR_CODE_INVALID_DATA;
|
return ErrorCode.ERROR_CODE_INVALID_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +44,12 @@ public class CreateGroupHandler extends GroupHandler<WFCMessage.CreateGroupReque
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Create_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
WFCMessage.GroupInfo groupInfo = m_messagesStore.createGroup(fromUser, request.getGroup().getGroupInfo(), request.getGroup().getMembersList(), request.getMemberExtra(), isAdmin);
|
WFCMessage.GroupInfo groupInfo = m_messagesStore.createGroup(fromUser, request.getGroup().getGroupInfo(), request.getGroup().getMembersList(), request.getMemberExtra(), isAdmin);
|
||||||
if (groupInfo != null) {
|
if (groupInfo != null) {
|
||||||
if(request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if(request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ public class DismissGroupHandler extends GroupHandler<WFCMessage.DismissGroupReq
|
|||||||
ErrorCode errorCode;
|
ErrorCode errorCode;
|
||||||
if (groupInfo == null) {
|
if (groupInfo == null) {
|
||||||
errorCode = m_messagesStore.dismissGroup(fromUser, request.getGroupId(), isAdmin);
|
errorCode = m_messagesStore.dismissGroup(fromUser, request.getGroupId(), isAdmin);
|
||||||
|
|
||||||
} else if (isAdmin || (groupInfo.getType() == ProtoConstants.GroupType.GroupType_Normal || groupInfo.getType() == ProtoConstants.GroupType.GroupType_Restricted)
|
} else if (isAdmin || (groupInfo.getType() == ProtoConstants.GroupType.GroupType_Normal || groupInfo.getType() == ProtoConstants.GroupType.GroupType_Restricted)
|
||||||
&& groupInfo.getOwner() != null && groupInfo.getOwner().equals(fromUser)) {
|
&& groupInfo.getOwner() != null && groupInfo.getOwner().equals(fromUser)) {
|
||||||
|
|
||||||
@@ -38,6 +37,13 @@ public class DismissGroupHandler extends GroupHandler<WFCMessage.DismissGroupReq
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Dismiss_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//send notify message first, then dismiss group
|
//send notify message first, then dismiss group
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
sendGroupNotification(fromUser, groupInfo.getTargetId(), request.getToLineList(), request.getNotifyContent());
|
sendGroupNotification(fromUser, groupInfo.getTargetId(), request.getToLineList(), request.getNotifyContent());
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ public class KickoffGroupMember extends GroupHandler<WFCMessage.RemoveGroupMembe
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Kickoff_Group_Member) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//send notify message first, then kickoff the member
|
//send notify message first, then kickoff the member
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
sendGroupNotification(fromUser, groupInfo.getTargetId(), request.getToLineList(), request.getNotifyContent());
|
sendGroupNotification(fromUser, groupInfo.getTargetId(), request.getToLineList(), request.getNotifyContent());
|
||||||
|
|||||||
@@ -31,6 +31,19 @@ public class ModifyGroupInfoHandler extends GroupHandler<WFCMessage.ModifyGroupI
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if(request.getType() == Modify_Group_Mute) {
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Mute_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Modify_Group_Info) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode errorCode= m_messagesStore.modifyGroupInfo(fromUser, request.getGroupId(), request.getType(), request.getValue(), isAdmin);
|
ErrorCode errorCode= m_messagesStore.modifyGroupInfo(fromUser, request.getGroupId(), request.getType(), request.getValue(), isAdmin);
|
||||||
if (errorCode == ERROR_CODE_SUCCESS) {
|
if (errorCode == ERROR_CODE_SUCCESS) {
|
||||||
if(request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if(request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ public class QuitGroupHandler extends GroupHandler<WFCMessage.QuitGroupRequest>
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Quit_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode errorCode = m_messagesStore.quitGroup(fromUser, request.getGroupId(), isAdmin);
|
ErrorCode errorCode = m_messagesStore.quitGroup(fromUser, request.getGroupId(), isAdmin);
|
||||||
if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {
|
if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ public class SetGroupManagerHandler extends GroupHandler<WFCMessage.SetGroupMana
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Set_Group_Manage) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode errorCode = m_messagesStore.setGroupManager(fromUser, request.getGroupId(), request.getType(), request.getUserIdList(), isAdmin);
|
ErrorCode errorCode = m_messagesStore.setGroupManager(fromUser, request.getGroupId(), request.getType(), request.getUserIdList(), isAdmin);
|
||||||
if (errorCode == ERROR_CODE_SUCCESS) {
|
if (errorCode == ERROR_CODE_SUCCESS) {
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ public class TransferGroupHandler extends GroupHandler<WFCMessage.TransferGroupR
|
|||||||
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(requestSourceType == ProtoConstants.RequestSourceType.Request_From_User) {
|
||||||
|
int forbiddenClientOperation = m_messagesStore.getGroupForbiddenClientOperation();
|
||||||
|
if((forbiddenClientOperation & ProtoConstants.ForbiddenClientGroupOperationMask.Forbidden_Transfer_Group) > 0) {
|
||||||
|
return ErrorCode.ERROR_CODE_NOT_RIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode errorCode = m_messagesStore.transferGroup(fromUser, request.getGroupId(), request.getNewOwner(), isAdmin);
|
ErrorCode errorCode = m_messagesStore.transferGroup(fromUser, request.getGroupId(), request.getNewOwner(), isAdmin);
|
||||||
if (errorCode == ERROR_CODE_SUCCESS) {
|
if (errorCode == ERROR_CODE_SUCCESS) {
|
||||||
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
if (request.hasNotifyContent() && request.getNotifyContent().getType() > 0) {
|
||||||
|
|||||||
@@ -25,9 +25,11 @@ public class UploadDeviceTokenHandler extends IMHandler<WFCMessage.UploadDeviceT
|
|||||||
session.setPlatform(request.getPlatform());
|
session.setPlatform(request.getPlatform());
|
||||||
session.setAppName(request.getAppName());
|
session.setAppName(request.getAppName());
|
||||||
if (request.getPlatform() == ProtoConstants.Platform.Platform_iOS && request.getPushType() == 2) {
|
if (request.getPlatform() == ProtoConstants.Platform.Platform_iOS && request.getPushType() == 2) {
|
||||||
|
LOG.info("Set device token, userId {}", fromUser);
|
||||||
session.setVoipDeviceToken(request.getDeviceToken());
|
session.setVoipDeviceToken(request.getDeviceToken());
|
||||||
m_sessionsStore.updateSessionToken(session, true);
|
m_sessionsStore.updateSessionToken(session, true);
|
||||||
} else {
|
} else {
|
||||||
|
LOG.info("Set device token, userId {}, platform {}, pushType {}", fromUser, session.getPlatform(), request.getPushType());
|
||||||
session.setDeviceToken(request.getDeviceToken());
|
session.setDeviceToken(request.getDeviceToken());
|
||||||
session.setPushType(request.getPushType());
|
session.setPushType(request.getPushType());
|
||||||
m_sessionsStore.updateSessionToken(session, false);
|
m_sessionsStore.updateSessionToken(session, false);
|
||||||
|
|||||||
@@ -1493,12 +1493,6 @@ public class DatabaseStore {
|
|||||||
if (!strEqual(session.getAppName(), request.getApp())) {
|
if (!strEqual(session.getAppName(), request.getApp())) {
|
||||||
sql += " `_package_name` = ?,";
|
sql += " `_package_name` = ?,";
|
||||||
}
|
}
|
||||||
if (session.getPlatform() != request.getPlatform()) {
|
|
||||||
sql += " `_platform` = ?,";
|
|
||||||
}
|
|
||||||
if (session.getPushType() != request.getPushType()) {
|
|
||||||
sql += " `_push_type` = ?,";
|
|
||||||
}
|
|
||||||
if (!strEqual(session.getDeviceName(), request.getDeviceName())) {
|
if (!strEqual(session.getDeviceName(), request.getDeviceName())) {
|
||||||
sql += " `_device_name` = ?,";
|
sql += " `_device_name` = ?,";
|
||||||
}
|
}
|
||||||
@@ -1526,12 +1520,6 @@ public class DatabaseStore {
|
|||||||
if (!strEqual(session.getAppName(), request.getApp())) {
|
if (!strEqual(session.getAppName(), request.getApp())) {
|
||||||
statement.setString(index++, request.getApp());
|
statement.setString(index++, request.getApp());
|
||||||
}
|
}
|
||||||
if (session.getPlatform() != request.getPlatform()) {
|
|
||||||
statement.setInt(index++, request.getPlatform());
|
|
||||||
}
|
|
||||||
if (session.getPushType() != request.getPushType()) {
|
|
||||||
statement.setInt(index++, request.getPushType() >= 32 ? 0 : request.getPushType());
|
|
||||||
}
|
|
||||||
if (!strEqual(session.getDeviceName(), request.getDeviceName())) {
|
if (!strEqual(session.getDeviceName(), request.getDeviceName())) {
|
||||||
statement.setString(index++, request.getDeviceName());
|
statement.setString(index++, request.getDeviceName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
private boolean mGroupAllowClientCustomOperationNotification;
|
private boolean mGroupAllowClientCustomOperationNotification;
|
||||||
private boolean mGroupAllowRobotCustomOperationNotification;
|
private boolean mGroupAllowRobotCustomOperationNotification;
|
||||||
private int mGroupVisibleQuitKickoffNotification;
|
private int mGroupVisibleQuitKickoffNotification;
|
||||||
|
private int mGroupForbiddenClientOperation;
|
||||||
private int mSyncDataPartSize = 0;
|
private int mSyncDataPartSize = 0;
|
||||||
private boolean keepDisplayNameWhenDestroyUser = true;
|
private boolean keepDisplayNameWhenDestroyUser = true;
|
||||||
|
|
||||||
@@ -460,6 +461,35 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String s = server.getConfig().getProperty(GROUP_Forbidden_Client_Operation, null);
|
||||||
|
if(!StringUtil.isNullOrEmptyAfterTrim(s)) {
|
||||||
|
s = s.toLowerCase();
|
||||||
|
if(s.startsWith("0x")) {
|
||||||
|
s = s.substring(2);
|
||||||
|
for (int i = 0; i < s.length(); i++) {
|
||||||
|
char ch = s.charAt(s.length()-1-i);
|
||||||
|
mGroupForbiddenClientOperation <<= 4;
|
||||||
|
if(ch <= 9) {
|
||||||
|
mGroupForbiddenClientOperation += ch;
|
||||||
|
} else {
|
||||||
|
if(ch > 'f' || ch < 'a') {
|
||||||
|
mGroupForbiddenClientOperation = 0;
|
||||||
|
LOG.error("Invalid group.forbidden_client_operation {}", server.getConfig().getProperty(GROUP_Forbidden_Client_Operation, null));
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
mGroupForbiddenClientOperation += (ch - 'a' + 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mGroupForbiddenClientOperation = Integer.parseInt(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
LOG.error("Invalid group.forbidden_client_operation {}", server.getConfig().getProperty(GROUP_Forbidden_Client_Operation, null));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mSyncDataPartSize = Integer.parseInt(server.getConfig().getProperty(SYNC_Data_Part_Size, "0"));
|
mSyncDataPartSize = Integer.parseInt(server.getConfig().getProperty(SYNC_Data_Part_Size, "0"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -4214,6 +4244,11 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
return mGroupVisibleQuitKickoffNotification;
|
return mGroupVisibleQuitKickoffNotification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupForbiddenClientOperation() {
|
||||||
|
return mGroupForbiddenClientOperation;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isForwardMessageWithClientInfo() {
|
public boolean isForwardMessageWithClientInfo() {
|
||||||
return mForwardMessageWithClientInfo;
|
return mForwardMessageWithClientInfo;
|
||||||
|
|||||||
@@ -233,6 +233,8 @@ public interface IMessagesStore {
|
|||||||
boolean isAllowRobotCustomGroupNotification();
|
boolean isAllowRobotCustomGroupNotification();
|
||||||
int getVisibleQuitKickoffNotification();
|
int getVisibleQuitKickoffNotification();
|
||||||
|
|
||||||
|
int getGroupForbiddenClientOperation();
|
||||||
|
|
||||||
boolean isForwardMessageWithClientInfo();
|
boolean isForwardMessageWithClientInfo();
|
||||||
boolean isRobotCallbackWithClientInfo();
|
boolean isRobotCallbackWithClientInfo();
|
||||||
boolean isChannelCallbackWithClientInfo();
|
boolean isChannelCallbackWithClientInfo();
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>0.99</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ public interface APIPath {
|
|||||||
String Conference_Create = "/admin/conference/create";
|
String Conference_Create = "/admin/conference/create";
|
||||||
String Conference_Destroy = "/admin/conference/destroy";
|
String Conference_Destroy = "/admin/conference/destroy";
|
||||||
String Conference_Recording = "/admin/conference/recording";
|
String Conference_Recording = "/admin/conference/recording";
|
||||||
|
String Conference_Rtp_Forward = "/admin/conference/rtp_forward";
|
||||||
|
String Conference_Stop_Rtp_Forward = "/admin/conference/stop_rtp_forward";
|
||||||
|
String Conference_List_Rtp_Forward = "/admin/conference/list_rtp_forward";
|
||||||
|
|
||||||
String Channel_User_Info = "/channel/user_info";
|
String Channel_User_Info = "/channel/user_info";
|
||||||
String Channel_Update_Profile = "/channel/update_profile";
|
String Channel_Update_Profile = "/channel/update_profile";
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public enum ErrorCode {
|
|||||||
ERROR_CODE_SECRET_CHAT_MO_DISABLED(86, "origin side disable secret chat"),
|
ERROR_CODE_SECRET_CHAT_MO_DISABLED(86, "origin side disable secret chat"),
|
||||||
ERROR_CODE_SECRET_CHAT_MT_DISABLED(87, "target side disable secret chat"),
|
ERROR_CODE_SECRET_CHAT_MT_DISABLED(87, "target side disable secret chat"),
|
||||||
|
|
||||||
|
ERROR_CODE_CONFERENCE_ERROR(90, "Conference server response error"),
|
||||||
|
|
||||||
ERROR_CODE_FUNCTION_DISABLED(220, "function disabled"),
|
ERROR_CODE_FUNCTION_DISABLED(220, "function disabled"),
|
||||||
|
|
||||||
ERROR_CODE_CHANNEL_NO_EXIST(236, "channel no exist"),
|
ERROR_CODE_CHANNEL_NO_EXIST(236, "channel no exist"),
|
||||||
|
|||||||
@@ -3,5 +3,7 @@ package cn.wildfirechat.pojos;
|
|||||||
public class ConferenceLeaveEvent {
|
public class ConferenceLeaveEvent {
|
||||||
public String userId;
|
public String userId;
|
||||||
public String roomId;
|
public String roomId;
|
||||||
|
public boolean rejoin;
|
||||||
|
public boolean kicked;
|
||||||
public boolean screenSharing;
|
public boolean screenSharing;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
package cn.wildfirechat.pojos;
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class PojoConferenceParticipant {
|
public class PojoConferenceParticipant {
|
||||||
|
public static class Stream {
|
||||||
|
public String type;
|
||||||
|
public String mid;
|
||||||
|
public String codec;
|
||||||
|
}
|
||||||
|
|
||||||
public String userId;
|
public String userId;
|
||||||
public boolean publishing;
|
public boolean publishing;
|
||||||
|
public List<Stream> streams;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class PojoConferenceRtpForwardReq {
|
||||||
|
public String roomId;
|
||||||
|
public String publisherId;
|
||||||
|
public String host;
|
||||||
|
public int audioPort;
|
||||||
|
public int audioPt;
|
||||||
|
public long audioSSRC;
|
||||||
|
public int videoPort;
|
||||||
|
public int videoPt;
|
||||||
|
public long videoSSRC;
|
||||||
|
|
||||||
|
public PojoConferenceRtpForwardReq() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PojoConferenceRtpForwardReq(String roomId, String publisherId, String host, int audioPort, int audioPt, long audioSSRC, int videoPort, int videoPt, long videoSSRC) {
|
||||||
|
this.roomId = roomId;
|
||||||
|
this.publisherId = publisherId;
|
||||||
|
this.host = host;
|
||||||
|
this.audioPort = audioPort;
|
||||||
|
this.audioPt = audioPt;
|
||||||
|
this.audioSSRC = audioSSRC;
|
||||||
|
this.videoPort = videoPort;
|
||||||
|
this.videoPt = videoPt;
|
||||||
|
this.videoSSRC = videoSSRC;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PojoConferenceRtpForwarders {
|
||||||
|
public static class RtpForwarder {
|
||||||
|
public static class RtpStream {
|
||||||
|
public long streamId;
|
||||||
|
public String type;
|
||||||
|
public String host;
|
||||||
|
public int port;
|
||||||
|
public long ssrc;
|
||||||
|
public int pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String publisherId;
|
||||||
|
public List<RtpStream> streams;
|
||||||
|
}
|
||||||
|
public String roomId;
|
||||||
|
public List<RtpForwarder> forwarders;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class PojoConferenceStopRtpForwardReq {
|
||||||
|
public String roomId;
|
||||||
|
public String publisherId;
|
||||||
|
public long streamId;
|
||||||
|
|
||||||
|
public PojoConferenceStopRtpForwardReq() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PojoConferenceStopRtpForwardReq(String roomId, String publisherId, long streamId) {
|
||||||
|
this.roomId = roomId;
|
||||||
|
this.publisherId = publisherId;
|
||||||
|
this.streamId = streamId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -292,6 +292,34 @@ public class ProtoConstants {
|
|||||||
int ApplicationType_Admin = 2;
|
int ApplicationType_Admin = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//禁止客户端群操作。
|
||||||
|
// 第1位是禁止创建群组,
|
||||||
|
// 第2位是禁止销毁群组,
|
||||||
|
// 3位禁止加入群,
|
||||||
|
// 4位禁止退出群,
|
||||||
|
// 5位禁止邀请群成员,
|
||||||
|
// 6位禁止移出群成员,
|
||||||
|
// 7位禁止转移群
|
||||||
|
// 8位禁止设置群管理员
|
||||||
|
// 9位禁止允许群成员(专业版支持),
|
||||||
|
// 10位禁止群禁言
|
||||||
|
// 11位禁止修改群组信息,
|
||||||
|
// 12位禁止群成员禁言(专业版支持)
|
||||||
|
public interface ForbiddenClientGroupOperationMask {
|
||||||
|
int Forbidden_Create_Group = 0x01;
|
||||||
|
int Forbidden_Dismiss_Group = 0x02;
|
||||||
|
int Forbidden_Join_Group = 0x04;
|
||||||
|
int Forbidden_Quit_Group = 0x08;
|
||||||
|
int Forbidden_Invite_Group_Member = 0x10;
|
||||||
|
int Forbidden_Kickoff_Group_Member = 0x20;
|
||||||
|
int Forbidden_Transfer_Group = 0x40;
|
||||||
|
int Forbidden_Set_Group_Manage = 0x80;
|
||||||
|
int Forbidden_Allow_Group_Member = 0x100;
|
||||||
|
int Forbidden_Mute_Group = 0x200;
|
||||||
|
int Forbidden_Modify_Group_Info = 0x400;
|
||||||
|
int Forbidden_Mute_Group_Member = 0x800;
|
||||||
|
}
|
||||||
|
|
||||||
public static final int MESSAGE_CONTENT_TYPE_CREATE_GROUP = 104;
|
public static final int MESSAGE_CONTENT_TYPE_CREATE_GROUP = 104;
|
||||||
public static final int MESSAGE_CONTENT_TYPE_ADD_GROUP_MEMBER = 105;
|
public static final int MESSAGE_CONTENT_TYPE_ADD_GROUP_MEMBER = 105;
|
||||||
public static final int MESSAGE_CONTENT_TYPE_KICKOF_GROUP_MEMBER = 106;
|
public static final int MESSAGE_CONTENT_TYPE_KICKOF_GROUP_MEMBER = 106;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!--<relativePath>../pom.xml</relativePath>-->
|
<!--<relativePath>../pom.xml</relativePath>-->
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>0.99</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>distribution</artifactId>
|
<artifactId>distribution</artifactId>
|
||||||
|
|||||||
@@ -44,6 +44,12 @@
|
|||||||
<fileMode>0755</fileMode>
|
<fileMode>0755</fileMode>
|
||||||
</file>
|
</file>
|
||||||
|
|
||||||
|
<file>
|
||||||
|
<source>src/main/scripts/stop.sh</source>
|
||||||
|
<outputDirectory>bin</outputDirectory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
</file>
|
||||||
|
|
||||||
<file>
|
<file>
|
||||||
<source>src/main/scripts/wildfirechat.bat</source>
|
<source>src/main/scripts/wildfirechat.bat</source>
|
||||||
<outputDirectory>bin</outputDirectory>
|
<outputDirectory>bin</outputDirectory>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ local_port 80
|
|||||||
## 是否使用内置DB。0使用mysql;1使用h2db。
|
## 是否使用内置DB。0使用mysql;1使用h2db。
|
||||||
## MySQL需要把事物隔离级别改成"Read committed",使用命令来修改"set global transaction_isolation='read-committed';",其他数据库默认已经是这个级别不用修改
|
## MySQL需要把事物隔离级别改成"Read committed",使用命令来修改"set global transaction_isolation='read-committed';",其他数据库默认已经是这个级别不用修改
|
||||||
## 如果使用MySQL,请在c3p0.xml文件中配置JDBC信息。
|
## 如果使用MySQL,请在c3p0.xml文件中配置JDBC信息。
|
||||||
|
## 如果是MySQL5.7,需要开启长索引的支持,在数据库中执行命令:"set global innodb_large_prefix=on;"。其他版本默认支持,不用修改。
|
||||||
embed.db 1
|
embed.db 1
|
||||||
|
|
||||||
## 是否自动清理历史消息记录,当为true时,IM服务会定时扫描t_messages_x和t_user_messages_x表,清除掉3年前的历史消息。
|
## 是否自动清理历史消息记录,当为true时,IM服务会定时扫描t_messages_x和t_user_messages_x表,清除掉3年前的历史消息。
|
||||||
@@ -168,6 +169,10 @@ group.allow_robot_custom_operation_notification true
|
|||||||
## 如果应用需要退群或者踢人不通知普通成员,请设置此参数为3,然后修改客户端踢人或退群消息的flag为not_presist。
|
## 如果应用需要退群或者踢人不通知普通成员,请设置此参数为3,然后修改客户端踢人或退群消息的flag为not_presist。
|
||||||
group.visible_quit_or_kickoff_notification 0
|
group.visible_quit_or_kickoff_notification 0
|
||||||
|
|
||||||
|
## 禁止客户端群操作。第1位是禁止创建群组,第2位是禁止销毁群组,3位禁止加入群,4位禁止退出群,5位禁止邀请群成员,6位禁止移出群成员,7位禁止转移群,8位禁止设置群管理员,9位禁止白名单处理,10位禁止群禁言,11位禁止修改群组信息,12位禁止群成员禁言。
|
||||||
|
## 如果有客户端有被破解的风险,可以禁止客户端群操作,然后通过Server API操作。Server API不受限制。
|
||||||
|
#group.forbidden_client_operation 0xFFF
|
||||||
|
|
||||||
## 隐藏用户信息属性类型,2是性别,3是电话号码,4是邮箱,5是地址,6是公司信息,7是社交账号,8是Extra信息。当需要隐藏多个时以英文逗号分开;
|
## 隐藏用户信息属性类型,2是性别,3是电话号码,4是邮箱,5是地址,6是公司信息,7是社交账号,8是Extra信息。当需要隐藏多个时以英文逗号分开;
|
||||||
## 本配置是为了提高安全性,避免把对应信息同步到客户端,这样就能防止程序被破解从而拿到用户关键信息。仅对客户端有效,server api不受影响。
|
## 本配置是为了提高安全性,避免把对应信息同步到客户端,这样就能防止程序被破解从而拿到用户关键信息。仅对客户端有效,server api不受影响。
|
||||||
## 注意,修改本配置不会对已经同步的信息产生影响。
|
## 注意,修改本配置不会对已经同步的信息产生影响。
|
||||||
|
|||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pid=`ps -ef | grep wildfirechat.server.Server | grep -v grep | awk '{print $2}'`
|
||||||
|
|
||||||
|
if [ -z $pid ]; then
|
||||||
|
echo "野火IM服务不存在"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
kill -15 $pid
|
||||||
|
|
||||||
|
for i in {1..15}
|
||||||
|
do
|
||||||
|
pid=`ps -ef | grep wildfirechat.server.Server | grep -v grep | awk '{print $2}'`
|
||||||
|
if [ -z $pid ]; then
|
||||||
|
echo "野火IM服务已结束"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "正在结束中,请等待..."
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "正常结束失败,强制结束!"
|
||||||
|
kill -9 $pid
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>0.99</version>
|
<version>1.0</version>
|
||||||
<name>Wildfire Chat</name>
|
<name>Wildfire Chat</name>
|
||||||
<description>Wildfire Chat Server</description>
|
<description>Wildfire Chat Server</description>
|
||||||
<inceptionYear>2019</inceptionYear>
|
<inceptionYear>2019</inceptionYear>
|
||||||
|
|||||||
@@ -12,6 +12,17 @@
|
|||||||
|
|
||||||
# 更新记录
|
# 更新记录
|
||||||
|
|
||||||
|
--------------
|
||||||
|
Release note 1.0:
|
||||||
|
1. SDK检查工具添加help命令
|
||||||
|
2. 去掉短连接端口被网络爬虫扫描输出的异常日志
|
||||||
|
3. API支持创建组织群
|
||||||
|
4. 添加配置禁止客户端进行某些群操作
|
||||||
|
5. 解决route请求时可能不能正确携带推送类型的问题
|
||||||
|
6. 会议成员离开加上离开原因
|
||||||
|
7. 添加停止程序的命令
|
||||||
|
8. 添加RTP Forward的API
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
Release note 0.99:
|
Release note 0.99:
|
||||||
1. API获取用户信息时,过滤掉已经删除用户。
|
1. API获取用户信息时,过滤掉已经删除用户。
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>0.99</version>
|
<version>1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -45,4 +45,23 @@ public class ConferenceAdmin {
|
|||||||
PojoConferenceRoomId conferenceRoomId = new PojoConferenceRoomId(roomId, advance);
|
PojoConferenceRoomId conferenceRoomId = new PojoConferenceRoomId(roomId, advance);
|
||||||
return AdminHttpUtils.httpJsonPost(path, conferenceRoomId, Void.class);
|
return AdminHttpUtils.httpJsonPost(path, conferenceRoomId, Void.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IMResult<Void> rtpForward(String roomId, String userId, String rtpHost, int audioPort, int audioPt, long audioSSRC, int videoPort, int videoPt, long videoSSRC) throws Exception {
|
||||||
|
String path = APIPath.Conference_Rtp_Forward;
|
||||||
|
PojoConferenceRtpForwardReq req = new PojoConferenceRtpForwardReq(roomId, userId, rtpHost, audioPort, audioPt, audioSSRC, videoPort, videoPt, videoSSRC);
|
||||||
|
return AdminHttpUtils.httpJsonPost(path, req, Void.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMResult<Void> stopRtpForward(String roomId, String userId, long streamId) throws Exception {
|
||||||
|
String path = APIPath.Conference_Stop_Rtp_Forward;
|
||||||
|
PojoConferenceStopRtpForwardReq req = new PojoConferenceStopRtpForwardReq(roomId, userId, streamId);
|
||||||
|
return AdminHttpUtils.httpJsonPost(path, req, Void.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMResult<PojoConferenceRtpForwarders> listRtpForwarders(String roomId) throws Exception {
|
||||||
|
String path = APIPath.Conference_List_Rtp_Forward;
|
||||||
|
PojoConferenceRoomId req = new PojoConferenceRoomId();
|
||||||
|
req.roomId = roomId;
|
||||||
|
return AdminHttpUtils.httpJsonPost(path, req, PojoConferenceRtpForwarders.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class Main {
|
|||||||
commercialServer = Boolean.parseBoolean(args[3]);
|
commercialServer = Boolean.parseBoolean(args[3]);
|
||||||
advanceVoip = Boolean.parseBoolean(args[4]);
|
advanceVoip = Boolean.parseBoolean(args[4]);
|
||||||
} else {
|
} else {
|
||||||
|
if(args.length == 1 && (args[0].equals("-h") || args[0].equals("--help") || args[0].equals("-help"))) {
|
||||||
|
System.out.println("Usage: java -jar checker.jar adminUrl adminSecret imUrl commercialServer advanceVoip \n e.g. java -jar checker.jar http://192.168.1.80:18080 123456 http://192.168.1.80 false false");
|
||||||
|
return;
|
||||||
|
}
|
||||||
System.out.println("Usage: java -jar checker.jar adminUrl adminSecret imUrl commercialServer advanceVoip \n e.g. java -jar checker.jar http://192.168.1.80:18080 123456 http://192.168.1.80 false false");
|
System.out.println("Usage: java -jar checker.jar adminUrl adminSecret imUrl commercialServer advanceVoip \n e.g. java -jar checker.jar http://192.168.1.80:18080 123456 http://192.168.1.80 false false");
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println();
|
System.out.println();
|
||||||
@@ -1704,5 +1708,31 @@ public class Main {
|
|||||||
System.out.println("list participants success");
|
System.out.println("list participants success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IMResult<PojoConferenceRtpForwarders> listForwarderResult = ConferenceAdmin.listRtpForwarders("6366963312");
|
||||||
|
if(listForwarderResult == null || listForwarderResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
|
System.out.println("list rtp forward failure");
|
||||||
|
} else {
|
||||||
|
System.out.println("list rtp forward success");
|
||||||
|
listForwarderResult.getResult().forwarders.forEach(rtpForwarder -> rtpForwarder.streams.forEach(rtpStream -> {
|
||||||
|
try {
|
||||||
|
IMResult<Void> stopRtpForwardResult = ConferenceAdmin.stopRtpForward(listForwarderResult.getResult().roomId, rtpForwarder.publisherId, rtpStream.streamId);
|
||||||
|
if(stopRtpForwardResult == null || stopRtpForwardResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
|
System.out.println("rtp forward stop failure");
|
||||||
|
} else {
|
||||||
|
System.out.println("rtp forward stop success");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
IMResult<Void> rtpForwardResult = ConferenceAdmin.rtpForward("6366963312", "cygqmws2k", "192.168.1.81", 10000, 111, 0, 10005, 98, 0);
|
||||||
|
if(rtpForwardResult == null || rtpForwardResult.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
|
System.out.println("rtp forward failure");
|
||||||
|
} else {
|
||||||
|
System.out.println("rtp forward success");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user