session-pysogs icon indicating copy to clipboard operation
session-pysogs copied to clipboard

Is there a way to make a "one way" chat like session updates?

Open dillfrescott opened this issue 3 years ago • 5 comments

One where only admins/mods can chat in. For announcements and stuff.

dillfrescott avatar Jan 15 '22 01:01 dillfrescott

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 avatar Jan 20 '22 20:01 jagerman

@jagerman Thank you so much! Where do I enter this command?

dillfrescott avatar Jan 20 '22 22:01 dillfrescott

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).

jagerman avatar Jan 20 '22 22:01 jagerman

Thank you!!

dillfrescott avatar Jan 20 '22 22:01 dillfrescott

Can this be done through the the sogs utility yet?

mdPlusPlus avatar Apr 11 '23 11:04 mdPlusPlus