toxcore icon indicating copy to clipboard operation
toxcore copied to clipboard

Possible to edit sent messages?

Open ggppjj opened this issue 11 years ago • 17 comments

In my years of using Skype, I've noticed one thing it does that none of the other comparable chat programs does: It allows you to edit or delete past messages. I was wondering if this would be possible to include in Tox-Core, or would be a good idea.I personally use it for fixing grammar mistakes, but it does make for a handy chat feature, and the ability to delete messages has saved me from a few potential slipups. Thank you for your consideration.

ggppjj avatar Feb 27 '14 04:02 ggppjj

Skype does this by sending a message that references the message to edit and what to edit it to. I don't see any reason this should be done in the core, though it would be interesting to see adopted in the applications.

micrictor avatar Mar 05 '14 05:03 micrictor

The issue is that because the clients are open, other clients may choose to ignore your edit message.

Which basically renders this completely useless

optimumtact avatar Apr 24 '14 02:04 optimumtact

If not establish editing messages from the beginning, it can happen as with XMPP - there is a XEP for editing messages, but not widely supported.

I want to be able to edit messages (including not the most recent one), about a half of my messages in Skype are edited. I don't like to re-read messages before sending and often send partially typed messages (immediately starting editing them to finish). I'd like to keep that workflow after Skype goes away.

other clients may choose to ignore your edit message.

More clever clients can show the full revision history of a message by click.

vi avatar Jun 22 '14 20:06 vi

It's the most valuable feature I missed upon skype.

archaim avatar Aug 06 '14 09:08 archaim

other clients may choose to ignore your edit message.

Not necessarily. At the moment each message has message_id which is used to ack that message was received. This could very well be used to signal message is edited simply by sending new message with same id. What happens if client does not support this feature? Client considers edited message as new message and adds it at the end of the log. Graceful failure.

I did that in my crappy python client and it works. However i noticed one problem - if friend goes offline then message_id resets to 1 so initially after reconnect all new messages were considered as edits. There are two possible solutions to this:

  • Client should stop editing previous messages when message_id resets either by watching friend's status switching to offline or by receiving message with id=1.
  • Use timestamp as message id. If more than 1 message is sent per second use last_used_timestamp + 1.

I like later option better because if clients keep track of message ids they then could issue message edits for previous sessions. Like after brief disconnect.

ghost avatar Dec 13 '14 12:12 ghost

This could very well be used to signal message is edited simply by sending new message with same id. What happens if client does not support this feature?

It leaks memory while building log hash.

czarkoff avatar Feb 16 '15 19:02 czarkoff

I would appreciate that feature.

srkunze avatar Feb 17 '15 13:02 srkunze

I miss that feature almost daily...

Talkless avatar Jul 12 '15 09:07 Talkless

Editing messages is an important usability feature for me, and should be supported by the core in some way (e.g. with unique message ID). How to handle edited messages (keep version histories, actually delete data, or ignore the edit and redisplay, etc) can of course be left to the clients.

ghost avatar Nov 30 '17 18:11 ghost

@sirius-c +1 for the comment as a whole. -1 for « keep version histories [...] can [...] be left to the clients. ». I hope you understand why.

SkyzohKey avatar Nov 30 '17 19:11 SkyzohKey

Sorry, no I don't understand. My point is that the user can choose a client according to his or her wishes, maybe focusing on data integrity (e.g. full version history of messages available is a browser), or simplicity (a la Skype), or whatever. How sophisticated or not a client is in handling edited messages can be a feature that results in client competition.

The core would just need to provide the functionality that a client can at all obtain the information that a message was edited in a reliable way. A simple client might well discard that information.

ghost avatar Nov 30 '17 20:11 ghost

@SkyzohKey how could toxcore library force client application (qTox or whatever) to not keep the old message? @sirius-c proposition is simply realistic.

Talkless avatar Dec 01 '17 08:12 Talkless

Maybe, the default behavior should allow editing for an hour or so and then leave it as it.

srkunze avatar Dec 01 '17 13:12 srkunze

@srkunze It could be a hard guideline, like "toxcore compatible clients MUST allow to edit message for an hour and clear old message from history/log". But that's gonna be only a guideline.

Even if all clients implement that guideline correctly, you still can recompile toxcore/client to, let's say print/save these edited messages. Enter big tox groupchat, and wait for a year until someone accidentally pastes some password or whatever.... No one will protect from privacy/leak issues. This is not some centralized proprietary chat system where this could be implemented (if you trust creators).

Still, this is useful feature just for sake of etiquette, to delete some silly programmers joke you wrote into your moms chat window, instead for some friend.

EDIT: some spelling errors.

Talkless avatar Dec 01 '17 14:12 Talkless

Because integrity. Not every client will maintain revision history if that's not included in ToxCore and having all the clients being able to support a key feature like that should be a priority IMHO.

SkyzohKey avatar Dec 01 '17 14:12 SkyzohKey

@SkyzohKey while I don't think this should be a toxcore feature. When are you gonna finish your human readable message format? I need it for uTox, because when I do implement the feature that will close this issue. uTox will need to use a new message format.

Also, it needs an array format for storing meta data as well.

GrayHatter avatar Dec 01 '17 21:12 GrayHatter

@GrayHatter http://beta.tox.chat/blog/post/3/tox-chat-logs-standard <-

SkyzohKey avatar Dec 02 '17 12:12 SkyzohKey