tc icon indicating copy to clipboard operation
tc copied to clipboard

Request: View Specific Chatter's History for session

Open bap14 opened this issue 9 years ago • 10 comments

This is a feature in-line with something Chatty has. Click on a chatter's name and add a new hotkey/button "h" to view that user's chat history for the current session. This would aid moderators being able to look at their history to see if a ban is needed, or just a purge/timeout. See the screenshot below for an example of the window that pops up.

Chatty Feature Screenshot

bap14 avatar Aug 22 '16 14:08 bap14

I've started looking at this, and I see two avenues of completion. The first would be to have a separate object which stores user messages by user, then by channel. So in effect you'd have something like:

{ <username>: { <channel_1>: [ messageObject, messageObject, messageObject ], <channel_2>: [messageObject, messageObject, messageObject] }, <username_2>: { <channel_3>: [ messageObject ] } }

The issue with this method is the duplication of data in two separate objects. The other option is to load a custom filter on the messages object when viewing that particular user's message history. The only issue with this is depending upon how long of a history the user has, it may take a while to filter through them.

A final option, and one that may be worth looking at in 2017 is to store messages in an SQLite database (or some other form) which would be easier to search/query for specific data. This would allow for cross-session history as well.

bap14 avatar Sep 08 '16 22:09 bap14

I think the filter may be the better option here. It would only cause a performance drop when a user's history is being looked at, while the other option ads overhead in all cases. The other option also causes memory leaks as messages are not dereferenced (unless we keep track of that, and again more overhead)

Also in general loops and comparisons (does this user have such username) are fast so I wouldn't worry about it too much. We can just let Angular do the filtering directly in the template.

But the thing I care about most is the UI.
Where would you display this list of messages? And would you need to rewrite a lot of the chat rendering code?

I've always wanted to avoid having extra windows, in my original vision I was going to have their messages show up in the user panel (same place where their picture shows up when you click on them).

But I'm open to ideas. That panel may not be wide enough, the font would have to be reduced.

mccxiv avatar Sep 09 '16 23:09 mccxiv

I think a good way to accomplish this would be to extend the chat backlog to also store the username in the database, then you could add an api call onto the backlog to get a chatters history for the session channel and display it a popup similar to the settings gui. Just my two cents. I could probably make a PR on the TB repo to accomplish that if you'd like as well.

scsddeputy avatar Dec 04 '16 11:12 scsddeputy

@scsddeputy I ended up implementing what you suggested (as it makes the most sense) and created a pull request for it. See mccxiv/tb#2 for its status. That is kind of the "first step" in getting this feature implemented.

@mccxiv As far as UI was concerned, I was thinking of an overlay. Maybe a "drawer" that comes down over the main chat window with some quick-moderation buttons at the top or bottom. I can mock something up when my computer stops giving me issues.

bap14 avatar Mar 18 '17 04:03 bap14

@bap14 i saw that. Was going to get around to it, but i have been swamped as of late, pr looks good though

scsddeputy avatar Mar 18 '17 04:03 scsddeputy

I know the feeling. Am waiting for a memory diagnostic to finish on my desktop, so I decided to work server-side and do something productive.

bap14 avatar Mar 18 '17 04:03 bap14

yeah, i have like 4 different projects going on right now and trying to balance equal time between all of them and im drowning lol

scsddeputy avatar Mar 18 '17 04:03 scsddeputy

Cheers, I've been trying to sort out my Apple Developer certificate stuff, that's what's blocking 7.0 from releasing...

mccxiv avatar Mar 18 '17 04:03 mccxiv

whats going on with it mccxiv?

scsddeputy avatar Mar 18 '17 04:03 scsddeputy

I know there's a thing called logviewer but I don't know if there's a visible API unless you talk to the owner.

Outsanity avatar Sep 02 '17 02:09 Outsanity