Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21f766880d | ||
|
|
fa7f76ffef | ||
|
|
d6d3eba8e6 | ||
|
|
19bd5e83e5 | ||
|
|
2cbbf0a516 |
+1
-1
@@ -5,7 +5,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
<artifactId>wildfirechat-parent</artifactId>
|
||||
<groupId>cn.wildfirechat</groupId>
|
||||
<version>0.55</version>
|
||||
<version>0.57</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>moquette-broker</artifactId>
|
||||
|
||||
@@ -1555,6 +1555,35 @@ public class DatabaseStore {
|
||||
}
|
||||
}
|
||||
|
||||
void clearMultiUser(String uid, String clientId) {
|
||||
long start = System.currentTimeMillis();
|
||||
LOG.info("clearMultiUser {}, {}", uid, clientId);
|
||||
Connection connection = null;
|
||||
PreparedStatement statement = null;
|
||||
try {
|
||||
connection = DBUtil.getConnection();
|
||||
String sql = "update t_user_session set _deleted = ?, _token = ?, _voip_token = ?, _dt = ? where _cid = ? and _uid <> ? and _deleted = 0";
|
||||
|
||||
statement = connection.prepareStatement(sql);
|
||||
int index = 1;
|
||||
statement.setInt(index++, 1);
|
||||
statement.setString(index++, "");
|
||||
statement.setString(index++, "");
|
||||
statement.setLong(index++, System.currentTimeMillis());
|
||||
|
||||
statement.setString(index++, clientId);
|
||||
statement.setString(index++, uid);
|
||||
int count = statement.executeUpdate();
|
||||
LOG.info("Update rows {}", count);
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
Utility.printExecption(LOG, e, RDBS_Exception);
|
||||
} finally {
|
||||
DBUtil.closeDB(connection, statement);
|
||||
}
|
||||
}
|
||||
|
||||
MemorySessionStore.Session createSession(String uid, String clientId, ClientSession clientSession, int platform) {
|
||||
Connection connection = null;
|
||||
PreparedStatement statement = null;
|
||||
|
||||
@@ -1535,8 +1535,6 @@ public class MemoryMessagesStore implements IMessagesStore {
|
||||
WFCMessage.GroupInfo groupInfo = mIMap.get(groupId);
|
||||
if (groupInfo == null) {
|
||||
return ErrorCode.ERROR_CODE_NOT_EXIST;
|
||||
} else if (groupInfo.getMemberUpdateDt() <= maxDt) {
|
||||
return ErrorCode.ERROR_CODE_NOT_MODIFIED;
|
||||
}
|
||||
|
||||
MultiMap<String, WFCMessage.GroupMember> groupMembers = hzInstance.getMultiMap(GROUP_MEMBERS);
|
||||
|
||||
@@ -375,7 +375,7 @@ public class MemorySessionStore implements ISessionsStore {
|
||||
session.setPlatform(platform);
|
||||
databaseStore.updateSessionPlatform(username, clientID, platform);
|
||||
}
|
||||
|
||||
databaseStore.clearMultiUser(username, clientID);
|
||||
|
||||
if (!supportMultiEndpoint && platform > 0) {
|
||||
databaseStore.clearMultiEndpoint(username, clientID, platform);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>wildfirechat-parent</artifactId>
|
||||
<groupId>cn.wildfirechat</groupId>
|
||||
<version>0.55</version>
|
||||
<version>0.57</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!--<relativePath>../pom.xml</relativePath>-->
|
||||
<artifactId>wildfirechat-parent</artifactId>
|
||||
<groupId>cn.wildfirechat</groupId>
|
||||
<version>0.55</version>
|
||||
<version>0.57</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>distribution</artifactId>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
@ECHO OFF
|
||||
|
||||
set "CURRENT_DIR=%cd%"
|
||||
if not "%WILDFIRECHAT_HOME%" == "" goto gotHome
|
||||
set "WILDFIRECHAT_HOME=%CURRENT_DIR%"
|
||||
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
||||
cd ..
|
||||
set "WILDFIRECHAT_HOME=%cd%"
|
||||
cd "%CURRENT_DIR%"
|
||||
set "CURRENT_DIR=%cd%"
|
||||
:gotHome
|
||||
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
||||
echo The WILDFIRECHAT_HOME environment variable is not defined correctly
|
||||
|
||||
@@ -11,11 +11,14 @@ while [ -h "$PRG" ]; do
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`/"$link"
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
cd $PRGDIR
|
||||
PRG="`pwd`"/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
cd $PRGDIR
|
||||
cd ..
|
||||
WILDFIRECHAT_HOME=`pwd`
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<artifactId>wildfirechat-parent</artifactId>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<version>0.55</version>
|
||||
<version>0.57</version>
|
||||
<name>Wildfire Chat</name>
|
||||
<description>Wildfire Chat Server</description>
|
||||
<inceptionYear>2019</inceptionYear>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>wildfirechat-parent</artifactId>
|
||||
<groupId>cn.wildfirechat</groupId>
|
||||
<version>0.55</version>
|
||||
<version>0.57</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ public class Main {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
IMResult<Void> result = RelationAdmin.sendFrienRequest("ff1", "ff2", "hello", true);
|
||||
IMResult<Void> result = RelationAdmin.sendFriendRequest("ff1", "ff2", "hello", true);
|
||||
if (result != null && result.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("send friend request success");
|
||||
} else {
|
||||
@@ -300,7 +300,7 @@ public class Main {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
result = RelationAdmin.sendFrienRequest("ff1", "ff2", "hello2", false);
|
||||
result = RelationAdmin.sendFriendRequest("ff1", "ff2", "hello2", false);
|
||||
if (result != null && result.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("success");
|
||||
} else {
|
||||
@@ -308,7 +308,7 @@ public class Main {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
result = RelationAdmin.sendFrienRequest("ff1", "ff2", "hello3", true);
|
||||
result = RelationAdmin.sendFriendRequest("ff1", "ff2", "hello3", true);
|
||||
if (result != null && result.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||
System.out.println("success");
|
||||
} else {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RelationAdmin {
|
||||
return AdminHttpUtils.httpJsonPost(path, input, OutputGetAlias.class);
|
||||
}
|
||||
|
||||
public static IMResult<Void> sendFrienRequest(String userId, String targetId, String reason, boolean force) throws Exception {
|
||||
public static IMResult<Void> sendFriendRequest(String userId, String targetId, String reason, boolean force) throws Exception {
|
||||
String path = APIPath.Friend_Send_Request;
|
||||
InputAddFriendRequest input = new InputAddFriendRequest();
|
||||
input.setUserId(userId);
|
||||
|
||||
Reference in New Issue
Block a user