Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6d3eba8e6 | ||
|
|
19bd5e83e5 | ||
|
|
2cbbf0a516 |
@@ -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) {
|
MemorySessionStore.Session createSession(String uid, String clientId, ClientSession clientSession, int platform) {
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
session.setPlatform(platform);
|
session.setPlatform(platform);
|
||||||
databaseStore.updateSessionPlatform(username, clientID, platform);
|
databaseStore.updateSessionPlatform(username, clientID, platform);
|
||||||
}
|
}
|
||||||
|
databaseStore.clearMultiUser(username, clientID);
|
||||||
|
|
||||||
if (!supportMultiEndpoint && platform > 0) {
|
if (!supportMultiEndpoint && platform > 0) {
|
||||||
databaseStore.clearMultiEndpoint(username, clientID, platform);
|
databaseStore.clearMultiEndpoint(username, clientID, platform);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
|
||||||
set "CURRENT_DIR=%cd%"
|
set "CURRENT_DIR=%cd%"
|
||||||
if not "%WILDFIRECHAT_HOME%" == "" goto gotHome
|
|
||||||
set "WILDFIRECHAT_HOME=%CURRENT_DIR%"
|
set "WILDFIRECHAT_HOME=%CURRENT_DIR%"
|
||||||
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
||||||
cd ..
|
cd ..
|
||||||
set "WILDFIRECHAT_HOME=%cd%"
|
set "WILDFIRECHAT_HOME=%cd%"
|
||||||
cd "%CURRENT_DIR%"
|
set "CURRENT_DIR=%cd%"
|
||||||
:gotHome
|
:gotHome
|
||||||
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
if exist "%WILDFIRECHAT_HOME%\bin\wildfirechat.bat" goto okHome
|
||||||
echo The WILDFIRECHAT_HOME environment variable is not defined correctly
|
echo The WILDFIRECHAT_HOME environment variable is not defined correctly
|
||||||
|
|||||||
@@ -11,11 +11,14 @@ while [ -h "$PRG" ]; do
|
|||||||
if expr "$link" : '/.*' > /dev/null; then
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
PRG="$link"
|
PRG="$link"
|
||||||
else
|
else
|
||||||
PRG=`dirname "$PRG"`/"$link"
|
PRGDIR=`dirname "$PRG"`
|
||||||
|
cd $PRGDIR
|
||||||
|
PRG="`pwd`"/"$link"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
PRGDIR=`dirname "$PRG"`
|
PRGDIR=`dirname "$PRG"`
|
||||||
|
cd $PRGDIR
|
||||||
cd ..
|
cd ..
|
||||||
WILDFIRECHAT_HOME=`pwd`
|
WILDFIRECHAT_HOME=`pwd`
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ public class Main {
|
|||||||
System.exit(-1);
|
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) {
|
if (result != null && result.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("send friend request success");
|
System.out.println("send friend request success");
|
||||||
} else {
|
} else {
|
||||||
@@ -300,7 +300,7 @@ public class Main {
|
|||||||
System.exit(-1);
|
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) {
|
if (result != null && result.getErrorCode() != ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("success");
|
System.out.println("success");
|
||||||
} else {
|
} else {
|
||||||
@@ -308,7 +308,7 @@ public class Main {
|
|||||||
System.exit(-1);
|
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) {
|
if (result != null && result.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
|
||||||
System.out.println("success");
|
System.out.println("success");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class RelationAdmin {
|
|||||||
return AdminHttpUtils.httpJsonPost(path, input, OutputGetAlias.class);
|
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;
|
String path = APIPath.Friend_Send_Request;
|
||||||
InputAddFriendRequest input = new InputAddFriendRequest();
|
InputAddFriendRequest input = new InputAddFriendRequest();
|
||||||
input.setUserId(userId);
|
input.setUserId(userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user