Paste and Send Thoughts

While going over https://issues.imfreedom.org/issue/PIDGIN-14628 I had some thoughts and I’m curious what others might think of them.

This sounds simple on the surface, but how should we handle existing text? Does the paste ignore any existing text and just send what’s on the clipboard or does it insert at the cursor and then send? If there’s selected text does the clipboard replace it? What if the clipboard doesn’t contain text/*?

Firefox’s paste and go just goes to the clipboard and ignore the existing URL which seems to be what I would expect in a URL bar, but someone in pidgin someone could write a message like you can find more information here and then hit paste and send with a clipboard of https://issues.imfreedom.org/issue/PIDGIN-14628 and expect it to complete the message.

Maybe an option like “send clipboard as message” would work better? that could work for images and other attachments too. This would of course skip any alt text or image modification or whatever else we’re looking to add, but that seems like behavior that’d be expected to me.

Anyone got any thoughts there?

Many browsers have a paste&go or paste&search or paste&whatever action.

I agree “send clipboard as message” is probably the better option and more clear phrasing in this case. I think the the user did want to include other text they would be pasting it into the message drafting area to format the full message including the text. I think you’ve come up with probably the best solution already.

Most things that have similar features support text, image and video data. Some only support text and images. Some additionally support audio. I think there would be an expectation by the users to support at least text and images. What happens if the protocol does not support attachments of that type?

2 Likes

Thanks for you input. The idea about manually pasting in an already drafted message does seem like the expected behavior and I guess I’m just trying to prepare for upended expectations :sweat_smile:

A little background before I get too deep. In purple 3 we a message can only contain text, and anything else (image, video, audio) is an attachment to that message. This doesn’t map to every protocol, but it’s close enough. For example, Matrix has types of messages (text, image, audio, etc.) so in purple 3 those would be messages with no text content and an attachment of said type. That also means multiple messages for multiple attachments because that’s just how matrix works.

We still need to figure out how to determine what the protocols support for attachments. Generally it’s an all or nothing, but there’s probably something out there that only supports image/* and nothing else. We’ll probably determine a mime type and then ask the protocol on a conversation basis because some protocols you can disable attachments in specific conversations and so on.

I agree with the “send clipboard as message” approach. Do that and leave whatever’s already in the input box for the user to handle.

1 Like

I’m going to be annoying and ask… what about text formatting? The standard behavior (as much as I hate it) is now to copy text with formatting and paste with formatting? Will it send with formatting? What happens to formatting the protocol does not support? Am I overthinking this?

What I plan to do is to give an option on the default being plain or with formatting and then it’d just use whichever, although that’d suggest that we should have an a pair of them in the context menu to…

send plain clipboard as message and send special clipboard as message. But maybe we just say screw that and use the setting because that’s what they’d expect?

Personally I wouldn’t need or use this feature because I’d be too afraid to send something by mistake when the clipboard contents are not what I expect. That aside I’m probably faster by doing Ctrl + V → Enter than right-clicking and looking for that option to click.

EDIT:

Actually if this feature is implemented, I’d like to deactivate it in the settings somehow because I often misclick stuff and I wouldn’t want to inadvertently click on it.

4 Likes

This seems like a strange feature request to spend time on. I think I‘d find it hard to find a less important feature than this. It saves just a single keystroke and comes with a higher risk of accidentally sending something you don’t want to send.

1 Like

I am not inspired of this idea.

a) It can be used unintentionally. The user may want to just paste, but there is a probability to accidentally choose “Paste and send” and it would automatically be sent.
While maybe that was not the intention yet.

b) We may not be always sure what is inside our copy buffer. Xorg at least has 2 copy buffers, or maybe if the user uses some clipboard manager, it is more complicated. I don’t use clipboard manager, but sometimes I copy, but copy buffer contains the previous copy, not the last. And I have some workarounds for it. It may happen that wrong copy buffer will be pasted and sent, and expose something which the user would be deeply unhappy about.

In case of similar feature of the web browser, if you paste something wrong to the address bar, it is not as crucial, usually, as sending some information to the contact that didn’t have to receive it.

1 Like

Triaging issues and I ran across this from 14 years ago.. https://issues.imfreedom.org/issue/PIDGIN-14285