Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Past chat history #40

Open
mxamber opened this issue Jul 9, 2017 · 2 comments
Open

Past chat history #40

mxamber opened this issue Jul 9, 2017 · 2 comments

Comments

@mxamber
Copy link

mxamber commented Jul 9, 2017

Hi,

it'd be great if Punk could show past chat histories after a restart. I tried this today, did a "test chat" with a friend, restarted Punk, and the past chat posts were gone.

Since Punk keeps logs anyway, I imagine it wouldn't be hard to load those and display them. The Steam client usually displays the last couple lines from previous chats, and having the Punk client display the entirety (or, if preferences are implemented some day, a customisable amount of past chats) would be a feature I've always missed with the default client.

@scholtzm
Copy link
Owner

scholtzm commented Jul 9, 2017

Yep, I was thinking about using the chat log to load previous chats messages - the only problem is that the chat log is stored in a human-readable file but it's not very easy to parse.

Official Steam client loads the last few messages from Steam servers, so I might implement that as well. However, that would only provide very limited functionality - like 10 last messages or so.

@scholtzm scholtzm changed the title [Feature request] Past chat history Past chat history Jul 9, 2017
@mxamber
Copy link
Author

mxamber commented Jul 9, 2017

I'm not a pro with JS, but wouldn't you be able to do a bit of RegEx magic on the logs? I assume it can't be that hard.

/\[([0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2})\]/ would get the date string, which IIRC is in a format JavaScript Date can read, and getting the chat text should be manageable as well. Get the posts separated by doing Array.split() with newline char on the text file. I'd say parsing the usernames to match SteamIDs would be the only hard part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants