uawdijnntqw1x1x1
IP : 18.119.213.42
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
axolotl.ru
/
www
/
bitrix
/
js
/
main
/
..
/
im
/
event-handler
/
src
/
reaction-handler.js
/
/
import { EventType, RestMethod } from "im.const"; import {Logger} from "im.lib.logger"; import { EventEmitter } from "main.core.events"; export class ReactionHandler { static types = { none: 'none', like: 'like', kiss: 'kiss', laugh: 'laugh', wonder: 'wonder', cry: 'cry', angry: 'angry' }; static actions = { auto: 'auto', plus: 'plus', minus: 'minus', set: 'set' }; constructor($Bitrix) { this.store = $Bitrix.Data.get('controller').store; this.restClient = $Bitrix.RestClient.get(); this.onSetMessageReactionHandler = this.onSetMessageReaction.bind(this); this.onOpenMessageReactionListHandler = this.onOpenMessageReactionList.bind(this); EventEmitter.subscribe(EventType.dialog.setMessageReaction, this.onSetMessageReactionHandler); EventEmitter.subscribe(EventType.dialog.openMessageReactionList, this.onOpenMessageReactionListHandler); } onSetMessageReaction({data}) { this.reactToMessage(data.message.id, data.reaction); } onOpenMessageReactionList({data}) { this.openMessageReactionList(data.message.id, data.values); } reactToMessage(messageId, reaction) { // let type = reaction.type || ReactionHandler.types.like; let action = reaction.action || ReactionHandler.actions.auto; if (action !== ReactionHandler.actions.auto) { action = action === ReactionHandler.actions.set ? ReactionHandler.actions.plus : ReactionHandler.actions.minus; } this.restClient.callMethod(RestMethod.imMessageLike, { 'MESSAGE_ID': messageId, 'ACTION': action }); } openMessageReactionList(messageId, values) { Logger.warn('Message reaction list not implemented yet!', messageId, values); } destroy() { EventEmitter.unsubscribe(EventType.dialog.setMessageReaction, this.onSetMessageReactionHandler); EventEmitter.unsubscribe(EventType.dialog.openMessageReactionList, this.onOpenMessageReactionListHandler); } }
/var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/main/../im/event-handler/src/reaction-handler.js