session-pysogs
session-pysogs copied to clipboard
Is there a way to make a "one way" chat like session updates?
One where only admins/mods can chat in. For announcements and stuff.
Yes, though Session doesn't yet have support for updating the newer pysogs room permissions. As a temporary measure, in pysogs you can use this query:
UPDATE rooms SET write = FALSE, upload = FALSE where token = 'some-room';
to disable the ability for regular users to post in the room. (Moderators/admins will still be allowed).
@jagerman Thank you so much! Where do I enter this command?
If this is a default sogs-standalone deb install then the database will be at /var/lib/session-open-group-server/sogs.db, and the sqlite3 command can be used interact with it (but be careful!):
sudo sqlite3 /var/lib/session-open-group-server/sogs.db
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
sqlite> SELECT token, name, read, write, upload FROM rooms WHERE token = 'some-room';
some-room|Some Room!|1|1|1
sqlite> UPDATE rooms SET write = FALSE, upload = FALSE WHERE token = 'some-room';
sqlite> SELECT token, name, read, write, upload FROM rooms WHERE token = 'some-room';
some-room|Some Room!|1|0|0
sqlite>
You'll need to change 'some-room' in those queries to whatever the room token is, of course.
(If you get a sqlite3: command not found error then you'll need to run: sudo apt install sqlite3 first to get the command-line sqlite interface).
Thank you!!
Can this be done through the the sogs utility yet?