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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add support for watermark in Web Socket, in [#96](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/96)

## [0.9.17] - 2018-08-31
### Changed
Expand Down
22 changes: 13 additions & 9 deletions src/directLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,25 +316,29 @@ export class DirectLine implements IBotConnection {
this.token = options.secret || options.token;
this.webSocket = (options.webSocket === undefined ? true : options.webSocket) && typeof WebSocket !== 'undefined' && WebSocket !== undefined;

if (options.domain)
if (options.domain) {
this.domain = options.domain;
}

if (options.conversationId) {
this.conversationId = options.conversationId;
}

if (options.watermark) {
if (this.webSocket)
console.warn("Watermark was ignored: it is not supported using websockets at the moment");
else
this.watermark = options.watermark;
this.watermark = options.watermark;
}

if (options.streamUrl) {
if (options.token && options.conversationId)
if (options.token && options.conversationId) {
this.streamUrl = options.streamUrl;
else
console.warn("streamUrl was ignored: you need to provide a token and a conversationid");
} else {
console.warn('streamUrl was ignored: you need to provide a token and a conversationid');
}
}
if (options.pollingInterval !== undefined)

if (options.pollingInterval !== undefined) {
this.pollingInterval = options.pollingInterval;
}

this.activity$ = (this.webSocket
? this.webSocketActivity$()
Expand Down