Closed TheFabulousPika closed 4 years ago
original code
function findChatFriendName() {
var activeTabIndex = findActiveTabIndex();
var activeChatBody = document.getElementsByClassName("DropTarget chatWindow MultiUserChat")[activeTabIndex];
var friendName = activeChatBody.getElementsByClassName("FriendChatTypingNotification")[0].innerText.split(" is typing a message...")[0];
return friendName;
}
fix
function findChatRoomName() {
var activeTabIndex = findActiveTabIndex();
var activeChatBody = document.getElementsByClassName("DropTarget chatWindow MultiUserChat")[activeTabIndex];
if (activeChatBody.getElementsByClassName("FriendChatTypingNotification").length > 0){
var friendName = activeChatBody.getElementsByClassName("FriendChatTypingNotification")[0].innerText.split(" is typing a message...")[0];
return friendName;
}
else {
return activeChatBody.getElementsByClassName("chatRoomGroupHeaderName")[0].innerHTML;
}
}
function and parameter names changed to chatRoomName from friendName
New function added to process server messages (people entering and leaving group chat room)
function msgserverMsg(a){
var serverMsg = '<span class="serverMsg">' + a.innerText + '</span><br />';
return serverMsg;
}
Group chat conversion does not work