Skip to content

Commit b7e4818

Browse files
committed
Update docs
1 parent 0bbe4bf commit b7e4818

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

docs/bot/rest-api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ All messages at once
343343
* `{{msg_all_op_msg_content}}` - All operator messages in the chat. All messages without `[<date>] [<nick>]` prefix within each message.
344344
* `{{msg_all_vis_msg_content}}` - All visitor messages in the chat. All messages without `[<date>] [<nick>]` prefix within each message.
345345
* `{{msg_all_vis_since_transfer_content}}` - All visitor messages in the chat since operator took over the chat. All messages without `[<date>] [<nick>]` prefix within each message.
346-
* `{{msg_all}}` - all chat messages.
346+
* `{{msg_all_since_transfer_content_date_nick}}` - All visitor messages in the chat since operator took over the chat. All messages with `[<date>] [<nick>]` prefix within each message.
347+
* `{{msg_all}}` - all chat messages. All messages with `[<date>] [<nick>]` and meta data including whisper messages.
347348
* `{{msg_all_conversation}}` - all chat messages without system and whisper messages.
348349
* `{{msg_items}}` - all chat messages objects encoded in JSON. Just do `json_decode` on passed variable
349350
* `{{msg_all_html}}` - all chat messages rendered as HTML. You might need to style classes.

docs/chat/chat.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,22 @@ You can also click right mouse button and see context menu related to a message.
3535
* `Quote` - will append message area with quoted message text.
3636
* General `lhchat,use` permission is required.
3737
* Chat must be not closed
38-
* `Edit` - will be visible if
39-
* Chat is not closed
40-
* Selected message is not the last one operator message and operator has `lhchat,editpreviousall` permission
41-
* Selected message is visitor message and operator has `lhchat,editpreviouvis` permission
42-
* Selected message is the last operator message and operator has `lhchat,editprevious` permission
38+
* `Edit` - will be visible if
39+
* Chat is not closed
40+
* Selected message is not the last operator message and operator has `lhchat,editpreviousall` permission
41+
* Selected message is visitor message and operator has `lhchat,editpreviouvis` permission
42+
* Selected message is the last operator message and operator has `lhchat,editprevious` permission
43+
* Edit history will be saved if operator does not have permission `'lhchat','no_edit_history'` or he is editing not his own message.
44+
* Two events wil be dispatched on successful message edit
45+
* `chat.message_updated` - General messages was updated event
46+
* `chat.message_updated_admin` - Event indicates that operator has an updated message manually. Should be listened if for example you want to add a subject to chat to indicate that it has a message modified by operator.
47+
```php
48+
// General messages was updated event
49+
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.message_updated', array('msg' => & $msg, 'chat' => & $Chat));
50+
51+
// Event indicates that admin has an updated message manually
52+
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.message_updated_admin', array('user' => $currentUser->getUserData(true), 'msg' => & $msg, 'chat' => & $Chat));
53+
```
4354
* `Remove` - Removes messages permanently from database
4455
* To remove `Visitor` message `lhchat,removemsgvi` permission is required
4556
* To remove `Operator` or `Bot` message `lhchat,removemsgop` permission is required. It will allow to remove message independently who wrote this message.
@@ -354,13 +365,15 @@ Shows mail sending to visitor modal window. ​![](/img/chat/send-mail.png)
354365

355366
![](/img/chat/send-mail-visitor.png)
356367

357-
Required permissions
368+
This option can be seen if
358369

359-
> 'lhchat','sendmail'
370+
* Operator has permission to `'lhmailconv','use_admin'` and there is a mailbox defined with same mail as in the department.
360371

361-
:::tip
362-
This option can be [disabled by department](department/department.md#miscellaneous).
363-
:::
372+
OR
373+
374+
* Operator has permission `'lhchat','sendmail'` and `Hide send e-mail button for operators in chat window` is not checked in [department settings](department/department.md#miscellaneous).
375+
* We will use mail module if that option is activated in `Mail general options` in mail module.
376+
* If above that option is not activated, we will use the default send mail a modal window.
364377

365378
### Changing chat status
366379

0 commit comments

Comments
 (0)