Skip to content

Commit 0193f78

Browse files
committed
Merge pull request #12 from bradmb/visitor-name-issue-11
Fixed Issue #11
2 parents 0d9f855 + ad7fedb commit 0193f78

File tree

7 files changed

+42
-39
lines changed

7 files changed

+42
-39
lines changed

sl.js/release/sl.js

Lines changed: 32 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sl.js/release/sl.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sl.js/release/sl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sl.js/source/app.events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
case "message":
1717
var messageData: Models.ISLSocketMessage = msgPreParse;
1818

19-
if (messageData.username !== undefined && messageData.username === Config.visitorName) {
19+
if (messageData.username !== undefined && messageData.username === VisitorDisplayName) {
2020
HtmlConstructor.AddChatMessage({
2121
icon_emoji: messageData.icons.image_64,
2222
text: messageData.text,

sl.js/source/app.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
ParentElement.cloneNode(true);
6767
ParentElement = null;
6868

69-
Config.visitorName = null;
69+
VisitorDisplayName = null;
7070

7171
AppWebSocket.CloseWebSocket();
7272
}

sl.js/source/app.messaging.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
var packet: Models.ISLMessage = {
1717
text: message,
18-
username: Config.visitorName,
18+
username: VisitorDisplayName,
1919
icon_emoji: Config.visitorIcon,
2020
timespan: ""
2121
};
@@ -39,7 +39,7 @@
3939
var packet: Models.ISLAttachment = {
4040
attachments: userDataPoints,
4141
text: message,
42-
username: Config.visitorName,
42+
username: VisitorDisplayName,
4343
icon_emoji: Config.visitorIcon,
4444
timespan: ""
4545
};

sl.js/source/app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module SLjs {
1616
"use strict";
1717

1818
export var VisitorId: string;
19+
export var VisitorDisplayName: string;
1920
export var Users: Models.ISLSupportUser[] = <any>{};
2021
export var AppWebSocket: Socket;
2122
export var AppHandler: ApplicationHandler;
@@ -72,7 +73,8 @@ module SLjs {
7273

7374
if (Config.visitorName === null || Config.visitorName === undefined) {
7475
HtmlConstructor.ConstructWelcomeWithName(function (visitorName: string) {
75-
Config.visitorName = "[" + VisitorId + "] " + visitorName + " (" + Config.applicationName + ")";
76+
Config.visitorName = visitorName;
77+
VisitorDisplayName = "[" + VisitorId + "] " + visitorName + " (" + Config.applicationName + ")";
7678
HtmlConstructor.ConstructConversationWindow();
7779

7880
AppWebSocket = new Socket();
@@ -81,7 +83,7 @@ module SLjs {
8183
});
8284
});
8385
} else {
84-
Config.visitorName = "[" + VisitorId + "] " + Config.visitorName + " (" + Config.applicationName + ")";
86+
VisitorDisplayName = "[" + VisitorId + "] " + Config.visitorName + " (" + Config.applicationName + ")";
8587
HtmlConstructor.ConstructConversationWindow();
8688

8789
AppWebSocket = new Socket();

0 commit comments

Comments
 (0)