Move inquiry stream to ee
This commit is contained in:
parent
6608c1ecea
commit
374da08c59
|
@ -1,12 +1,12 @@
|
||||||
import log from '../../../utils/log';
|
import log from '../../../../utils/log';
|
||||||
import store from '../../createStore';
|
import store from '../../../../lib/createStore';
|
||||||
import RocketChat from '../../rocketchat';
|
import RocketChat from '../../../../lib/rocketchat';
|
||||||
import {
|
import {
|
||||||
inquiryRequest,
|
inquiryRequest,
|
||||||
inquiryQueueAdd,
|
inquiryQueueAdd,
|
||||||
inquiryQueueUpdate,
|
inquiryQueueUpdate,
|
||||||
inquiryQueueRemove
|
inquiryQueueRemove
|
||||||
} from '../../../ee/omnichannel/actions/inquiry';
|
} from '../../actions/inquiry';
|
||||||
|
|
||||||
const removeListener = listener => listener.stop();
|
const removeListener = listener => listener.stop();
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ export default function subscribeInquiry() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
connectedListener = this.sdk.onStreamData('connected', handleConnection);
|
connectedListener = RocketChat.onStreamData('connected', handleConnection);
|
||||||
disconnectedListener = this.sdk.onStreamData('close', handleConnection);
|
disconnectedListener = RocketChat.onStreamData('close', handleConnection);
|
||||||
queueListener = this.sdk.onStreamData(streamTopic, handleQueueMessageReceived);
|
queueListener = RocketChat.onStreamData(streamTopic, handleQueueMessageReceived);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { user } = store.getState().login;
|
const { user } = store.getState().login;
|
||||||
|
@ -74,13 +74,13 @@ export default function subscribeInquiry() {
|
||||||
const { departments } = result;
|
const { departments } = result;
|
||||||
|
|
||||||
if (!departments.length || RocketChat.hasRole('livechat-manager')) {
|
if (!departments.length || RocketChat.hasRole('livechat-manager')) {
|
||||||
this.sdk.subscribe(streamTopic, 'public').catch(e => console.log(e));
|
RocketChat.subscribe(streamTopic, 'public').catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
const departmentIds = departments.map(({ departmentId }) => departmentId);
|
const departmentIds = departments.map(({ departmentId }) => departmentId);
|
||||||
departmentIds.forEach((departmentId) => {
|
departmentIds.forEach((departmentId) => {
|
||||||
// subscribe to all departments of the agent
|
// subscribe to all departments of the agent
|
||||||
this.sdk.subscribe(streamTopic, `department/${ departmentId }`).catch(e => console.log(e));
|
RocketChat.subscribe(streamTopic, `department/${ departmentId }`).catch(e => console.log(e));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -19,7 +19,7 @@ import {
|
||||||
} from '../actions/share';
|
} from '../actions/share';
|
||||||
|
|
||||||
import subscribeRooms from './methods/subscriptions/rooms';
|
import subscribeRooms from './methods/subscriptions/rooms';
|
||||||
import subscribeInquiry from './methods/subscriptions/inquiry';
|
import subscribeInquiry from '../ee/omnichannel/lib/subscriptions/inquiry';
|
||||||
import getUsersPresence, { getUserPresence, subscribeUsersPresence } from './methods/getUsersPresence';
|
import getUsersPresence, { getUserPresence, subscribeUsersPresence } from './methods/getUsersPresence';
|
||||||
|
|
||||||
import protectedFunction from './methods/helpers/protectedFunction';
|
import protectedFunction from './methods/helpers/protectedFunction';
|
||||||
|
|
Loading…
Reference in New Issue