Skip to content

Chat history but in SQLite#166

Draft
Python1320 wants to merge 4 commits into
Earu:masterfrom
Python1320:patch-chathistory
Draft

Chat history but in SQLite#166
Python1320 wants to merge 4 commits into
Earu:masterfrom
Python1320:patch-chathistory

Conversation

@Python1320
Copy link
Copy Markdown
Contributor

Unfortunately coded with Opencode Big Pickle as an experiment so I will still need to comb through everything and squash the loading problem, but it works:

image

Tables:

-- global, player, admin, etc in name, id is just autoincrement
CREATE TABLE ec_channels (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	name TEXT NOT NULL UNIQUE
)

-- actual history, mapped via channel_id so we save at least somewhat on storage space. probably not worth it...
CREATE TABLE ec_history (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	channel_id INTEGER NOT NULL, 
	data TEXT NOT NULL,
	created_at INTEGER NOT NULL
)

Concerns:

  1. There are no old file migrations
  2. the old files will be left as is for now until I can be sure this new one works.
  3. Broken SQLite (on startup or during operation) should not take down easychat. I have not tested this yet.

Future:

  1. should add history length config and whatnot
  2. Maybe also store chat input history here (lua commands at least)

 - into sqlite
 - includes colors
(an attempt with opencode big pickle with some manual testing and sanity checking)
Comment thread lua/easychat/easychat.lua
if richtext.HistoryName then
richtext._Segments = {}
end
local segs = richtext._Segments
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seggs

@Earu
Copy link
Copy Markdown
Owner

Earu commented Jun 3, 2026

@Python1320 do you save steamid information? What about player information in general, like what happens if I click on someone's name in the history, do the correct menus show up?

@Earu
Copy link
Copy Markdown
Owner

Earu commented Jun 3, 2026

Additionally one of the features of the current history was that it was easily accessible/readable in the data folder, i think if we're using sqlite, there should at least be a way to see your histories somewhere in settings and/or to export them as .txt

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants