统一推送格式
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import {Application, BackendSession} from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS } from '../../../consts';
|
||||
|
||||
|
||||
export default function(app: Application) {
|
||||
@@ -29,13 +31,13 @@ export class ChatHandler {
|
||||
|
||||
// the target is all users
|
||||
if (msg.target === '*') {
|
||||
channel.pushMessage('onChat', param);
|
||||
channel.pushMessage('onChat', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
// the target is specific user
|
||||
else {
|
||||
let tuid = msg.target + '*' + rid;
|
||||
let tsid = channel.getMember(tuid)['sid'];
|
||||
channelService.pushMessageByUids('onChat', param, [{
|
||||
channelService.pushMessageByUids('onChat', resResult(STATUS.SUCCESS, param), [{
|
||||
uid: tuid,
|
||||
sid: tsid
|
||||
}]);
|
||||
@@ -55,13 +57,13 @@ export class ChatHandler {
|
||||
|
||||
// the target is all users
|
||||
if (msg.target === '*') {
|
||||
channel.pushMessage('onChat', param);
|
||||
channel.pushMessage('onChat', resResult(STATUS.SUCCESS, param));
|
||||
}
|
||||
// the target is specific user
|
||||
else {
|
||||
let tuid = msg.target + '*' + rid;
|
||||
let tsid = channel.getMember(tuid)['sid'];
|
||||
channelService.pushMessageByUids('onChat', param, [{
|
||||
channelService.pushMessageByUids('onChat', resResult(STATUS.SUCCESS, param), [{
|
||||
uid: tuid,
|
||||
sid: tsid
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user