Bug 269996 - Strip down HTML when copying from chat view
Summary: Strip down HTML when copying from chat view
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: text-ui (show other bugs)
Version: git-latest
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 0.4.0
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-03 13:31 UTC by Martin Klapetek
Modified: 2012-07-06 12:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot with the bug (97.64 KB, image/png)
2011-04-03 13:32 UTC, Martin Klapetek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klapetek 2011-04-03 13:31:26 UTC
Version:           git-latest (using KDE 4.6.1) 
OS:                Linux

When copying a longer portion of content from chat view, it copies html and then when pasted into chat input, it pastes the html including the avatars etc. See the attached screenshot.

Reproducible: Always
Comment 1 Martin Klapetek 2011-04-03 13:32:15 UTC
Created attachment 58536 [details]
Screenshot with the bug
Comment 2 David Edmundson 2011-04-03 16:30:14 UTC
I think it copies both the HTML and plaintext, as you can have various mimetypes in the clipboard at any time.

At which point we may be able to get away with just running
setAcceptRichText(false) in the ChatTextEdit.

(not tested)
Comment 3 Martin Klapetek 2011-04-03 16:38:19 UTC
That could work, yeah, also for different sources which would otherwise paste a "garbled" text. Although we should probably also consider a use case, where you want to copy the conversation and paste it elsewhere (mail, pastebin etc.).
Comment 4 Francesco Nwokeka 2011-04-03 17:22:20 UTC
(In reply to comment #2)
> I think it copies both the HTML and plaintext, as you can have various
> mimetypes in the clipboard at any time.
> 
> At which point we may be able to get away with just running
> setAcceptRichText(false) in the ChatTextEdit.
> 
> (not tested)
The setAcceptRichText(false) in the ChatTextEdit works as it eliminates all html and pastes only text. It's a one line patch.
(tested)
Is there anything else we're supposed to look out for?
Comment 5 David Edmundson 2011-04-05 00:36:09 UTC
Ship it!
We can deal with anything else if/when it comes up.
Comment 6 Francesco Nwokeka 2011-04-05 00:51:02 UTC
Git commit 8586347e2e6f8cdd65fc0a8b2b004af65e007458 by Francesco Nwokeka.
Committed on 05/04/2011 at 00:58.
Pushed by nwokeka into branch 'master'.

FIX: Strip down HTML when copying from chat view

BUG: 269996
REVIEW: David Edmundson

set the "setAcceptRichText" to false so we don't accept anything unwanted apart from normal text

M  +3    -0    lib/chat-text-edit.cpp     

http://commits.kde.org/telepathy-chat-handler/8586347e2e6f8cdd65fc0a8b2b004af65e007458
Comment 7 Martin Klapetek 2011-04-05 00:57:38 UTC
Great it is fixed. But consider the use cases in comment 3, we should consider different targets for pasting, therefore we should fix the source, not the (one) target.