Delete messages from all Talk rooms/private conversations via MySQL query

Is there anyone that knows the exact MySQL syntax to delete the messages (text) from any room/private conversation?

Or are Nextcloud Talk messages only stored on the devices?

If anyone could tell me how to to this, I’d be very much appreciated. I’m about to reinstall Nextcloud because my disk space is almost all gone, and that means that my friends will need to re-register again.

I already have automatic tagging for files and a retention policy running.

That’s the only thing I’m missing.

Thanks in advance!

Talk messages are stored in the same location as FIle Comments - in the database table called oc_comments
object_id is the conversation ID I think
object_type is the kind of app, so look for “chat”
Use phpMyAdmin to have a look.

1 Like

hi guys, I had a look into my mariadb database, and I found the “oc_comments” table, as you said, so over there is stored the conversations; I tested deleting one, but as I was suspecting from the frontend, talk app (android), webapp, the comment stills there; thus we should delete it from other places as well, I will continue inspect this possibility.
Regarding the “php /var/www/html/occ” option into the nextcloud app I do not know if over here we can approach it, below the output wanted:

$ php /var/www/html/occ 
  talk:active-calls                      Allows you to check if calls are currently in process
  talk:command:add                       Add a new command
  talk:command:add-samples               Adds some sample commands: /wiki, …
  talk:command:delete                    Remove an existing command
  talk:command:list                      List all available commands
  talk:command:update                    Add a new command
  talk:room:add                          Adds users to a room
  talk:room:create                       Create a new room
  talk:room:delete                       Deletes a room
  talk:room:demote                       Demotes participants of a room to regular users
  talk:room:promote                      Promotes participants of a room to moderators
  talk:room:remove                       Remove users from a room
  talk:room:update                       Updates a room
  talk:signaling:add                     Add an external signaling server.
  talk:signaling:delete                  Remove an existing signaling server.
  talk:signaling:list                    List external signaling servers.
  talk:stun:add                          Add a new STUN server.
  talk:stun:delete                       Remove an existing STUN server.
  talk:stun:list                         List STUN servers.
  talk:turn:add                          Add a TURN server.
  talk:turn:delete                       Remove an existing TURN server.
  talk:turn:list                         List TURN servers.

Btw, this issue request was useful to me thx. If I can find something new I will let you know.

Hello, I found the query to delete the comments created into a chat room, thx to terrox explanation. You have to filter by id.

DELETE FROM nextcloud.oc_comments
WHERE id=xxx;

I already tested it and it worked. Also I created a little guide, how to open mysql database through Dbeaver here
thank you

How to find the correct ID?

Crude but effective:

  • In Talk, click the three-dots for the message you are planning to delete
  • Select “Copy Message Link”
  • Paste into a text editor (Or any other way to view the copied link)
  • At the end of the copied link is the message number.

Not sure why Nextcloud thinks they need to make this so damn difficult. It’s our data/our servers, not theirs. The non-configurable six-hour delete limit is some serious navel-gazing behavior.