Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/integration/message-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ Add `defaultAutoLogMessageEnabled` into the `adapter.js` URI:
</script>
```

Listen to `Auto log messages` setting changed:

```js
window.addEventListener('message', function (e) {
var data = e.data;
if (data && data.type === 'rc-messageLogger-auto-log-notify') {
console.log('rc-messageLogger-auto-log-notify:', data.autoLog);
}
});
```

## Add message log entity matcher

In message logger, widget needs to know if messages are logged. To provide `messageLogEntityMatcherPath` when register, widget will send match request to get match result of messages history.
Expand Down
18 changes: 18 additions & 0 deletions src/modules/Adapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
'MessageStore',
'TabManager',
'CallLogger',
'ConversationLogger',
'GenericMeeting',
'Brand',
'Conversations',
Expand Down Expand Up @@ -98,6 +99,7 @@ export default class Adapter extends AdapterModuleCore {
disableInactiveTabCallEvent,
tabManager,
callLogger,
conversationLogger,
genericMeeting,
brand,
appFeatures,
Expand Down Expand Up @@ -131,6 +133,7 @@ export default class Adapter extends AdapterModuleCore {
this._tabManager = this:: ensureExist(tabManager, 'tabManager');
this._alert = alert;
this._callLogger = callLogger;
this._conversationLogger = conversationLogger;
this._extensionInfo = extensionInfo;
this._accountInfo = accountInfo;
this._meeting = genericMeeting;
Expand All @@ -155,6 +158,7 @@ export default class Adapter extends AdapterModuleCore {
this._callWith = null;
this._ringoutMyLocation = null;
this._callLoggerAutoLogEnabled = null;
this._conversationLoggerAutoLogEnabled = null;
this._dialerDisabled = null;
this._meetingReady = null;
this._brandConfig = null;
Expand Down Expand Up @@ -247,6 +251,7 @@ export default class Adapter extends AdapterModuleCore {
this._checkRouteChanged();
this._checkCallingSettingsChanged();
this._checkAutoCallLoggerChanged();
this._checkAutoConversationLoggerChanged();
this._checkDialUIStatusChanged();
this._checkMeetingStatusChanged();
this._checkBrandConfigChanged();
Expand Down Expand Up @@ -532,6 +537,19 @@ export default class Adapter extends AdapterModuleCore {
}
}

_checkAutoConversationLoggerChanged() {
if (!this._conversationLogger.ready) {
return;
}
if (this._conversationLoggerAutoLogEnabled !== this._conversationLogger.autoLog) {
this._conversationLoggerAutoLogEnabled = this._conversationLogger.autoLog;
this._postMessage({
type: 'rc-messageLogger-auto-log-notify',
autoLog: this._conversationLogger.autoLog,
});
}
}

_checkCallingSettingsChanged() {
if (!this._callingSettings.ready) {
return;
Expand Down