Skip to content

Commit

Permalink
Removing onPostActivity per CR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffders committed Apr 6, 2018
1 parent 9c87aa3 commit 9a2b2d8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/directLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,12 @@ export interface IBotConnection {
end(): void,
referenceGrammarId?: string,
postActivity(activity: Activity): Observable<string>,
getSessionId(): Observable<string>,
onPostActivity: Observable<Activity>
getSessionId(): Observable<string>
}

export class DirectLine implements IBotConnection {
public connectionStatus$ = new BehaviorSubject(ConnectionStatus.Uninitialized);
public activity$: Observable<Activity>;
public onPostActivity: Observable<Activity>;
private onPostActivitySubject: Subject<Activity>;

private domain = "https://directline.botframework.com/v3/directline";
private webSocket;
Expand All @@ -317,9 +314,6 @@ export class DirectLine implements IBotConnection {
this.token = options.secret || options.token;
this.webSocket = (options.webSocket === undefined ? true : options.webSocket) && typeof WebSocket !== 'undefined' && WebSocket !== undefined;

this.onPostActivitySubject = new Subject<Activity>();
this.onPostActivity = this.onPostActivitySubject.asObservable();

if (options.domain)
this.domain = options.domain;
if (options.conversationId) {
Expand Down Expand Up @@ -509,8 +503,6 @@ export class DirectLine implements IBotConnection {
}

postActivity(activity: Activity) {
this.onPostActivitySubject.next(activity);

// Use postMessageWithAttachments for messages with attachments that are local files (e.g. an image to upload)
// Technically we could use it for *all* activities, but postActivity is much lighter weight
// So, since WebChat is partially a reference implementation of Direct Line, we implement both.
Expand Down

0 comments on commit 9a2b2d8

Please sign in to comment.