Author Topic: Need help: Lock chat after operator log-out or exit it  (Read 7117 times)

0 Members and 3 Guests are viewing this topic.

tino

  • Jr. Member
  • **
  • Posts: 3
Need help: Lock chat after operator log-out or exit it
« on: January 16, 2014, 09:09:14 AM »
Hello guys, thanks for your effort to build this great open source app. I need little bit of help.

I want to lock chat so that client can't post any messages after operator left the that. Is there any simple code modification to unique identify message "Operator Name Surname left the chat".

Thanks in advance !
Tino

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Need help: Lock chat after operator log-out or exit it
« Reply #1 on: January 16, 2014, 08:10:51 PM »
I want to lock chat so that client can't post any messages after operator left the that.
I'm afraid there is no simple way to implement such feature in Mibew Messenger 1.6.x.

Is there any simple code modification to unique identify message "Operator Name Surname left the chat".
What do you mean? Where do you want to identify this message and what you gonna do with this information?

tino

  • Jr. Member
  • **
  • Posts: 3
Re: Need help: Lock chat after operator log-out or exit it
« Reply #2 on: January 17, 2014, 10:45:03 AM »
I'm afraid there is no simple way to implement such feature in Mibew Messenger 1.6.x.
Well after some time i spend looking at mibew code, i founded that it is not gonna be too easy but i have to do. So i did it like this...
  • chat.php@550 in chat.status.operator.left message, I concated some set of strange symbols that anyone will not post like normal message, like $message . "_/\_" 
  • chat.js@195, i'm just looking for that symbols in message in javascript, if there are it means that operator left chat, and i set window.AgentLeftTheChat = true
  • chat.js@142, if there is variable window.AgentLeftTheChat, i just trigger alert and do return, and chat conversation is locked..

What do you mean? Where do you want to identify this message and what you gonna do with this information?
From description above i hope you got what i wanted to do. In first place i was looking for some kind of message type/status, and i founded that ikind in messages DB was 6 when operator left or enter in chat, that almost help me to solve my problem but i could not find difference between actions entering and leaving some conversation :)

Never mind, i founded some kind of simple solution that i'm happy with and it works.
Thanks for this peace of code once more, keep it open  8)

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Need help: Lock chat after operator log-out or exit it
« Reply #3 on: January 17, 2014, 02:41:59 PM »
Never mind, i founded some kind of simple solution that i'm happy with and it works.

OK then.  :)

Thanks for this peace of code once more, keep it open  8)

We will.  :)