mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 18:26:37 +02:00
refactor(socket.io): deprecate SocketModules.chats.hasPrivateChat in favour of api.users.getPrivateRoomId
This commit is contained in:
@@ -71,10 +71,15 @@ SocketModules.chats.getRecentChats = async function (socket, data) {
|
||||
};
|
||||
|
||||
SocketModules.chats.hasPrivateChat = async function (socket, uid) {
|
||||
sockets.warnDeprecated(socket, 'GET /api/v3/users/:uid/chat');
|
||||
|
||||
if (socket.uid <= 0 || uid <= 0) {
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
return await Messaging.hasPrivateChat(socket.uid, uid);
|
||||
|
||||
// despite the `has` prefix, this method actually did return the roomId.
|
||||
const { roomId } = await api.users.getPrivateRoomId(socket, { uid });
|
||||
return roomId;
|
||||
};
|
||||
|
||||
SocketModules.chats.getIP = async function (socket, mid) {
|
||||
|
||||
Reference in New Issue
Block a user