TheFabulousPika / steam-chatlog-to-text

A chrome extension that converts Steam webchat log to text format
2 stars 0 forks source link

Add formatting for Group Chat invitation #41

Closed TheFabulousPika closed 4 years ago

TheFabulousPika commented 4 years ago

<div class="msgText " data-copytext="">
  <div class="ChatMessageInvite NoBGSplitInvite Inviter" data-copytext="Go to Group Chat
Broadcast Windows Games">
    <div class="leftInviteContainer">
      <div class="ChatRoomGroupAvatar Small"><img class="ChatRoomGroupAvatar_Avatar" src="https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/a8/a88be9bba3e5f5c55c0391ea8fab25aa5d8f2cce_medium.jpg"></div>
    </div>
    <div class="rightInviteContainer rightInvite_Horizontal">
      <div class="rightInviteContainerContent">
        <div class="inviteLabel">You invited <span class="inviteHighlight">user </span> to a group chat</div>
        <div>
          <div class="groupName">Broadcast Windows Games</div>
        </div>
      </div><button class="inviteButton inviteButtonJoinChat" type="button">Go to Group Chat</button>
    </div>
    <div style="clear: left;"></div>
  </div>
</div>
TheFabulousPika commented 4 years ago

Expired invitation


<div class="msgText " data-copytext="">
  <div class="ChatMessageInvite InviteExpired">
    <div class="postedExpiredInvite">A Group Chat invite was shared that is no longer valid</div>
  </div>
</div>
TheFabulousPika commented 4 years ago

    else if (checkFormatting(thisMsgNode,"ChatMessageInvite")){
        if (checkFormatting(thisMsgNode,"InviteExpired")){
        cleanedMsgText = 'A Group Chat invite was shared that is no longer valid';
        }
        else {
        cleanedMsgText = grabFirstInnerHTMLQueryClass(thisMsgNode,"inviteLabel") + '<br />' + grabFirstInnerHTMLQueryClass(thisMsgNode,"groupName");
        }
    }