Have some way of displaying messages which have images



3 years ago
a year ago


(Reporter: Mook, Unassigned)



Firefox Tracking Flags

(Not tracked)





3 years ago
It looks like nobody is paying attention to prplIMessage.containsImages.

I'd like to implement a chat protocol which can have image attachments.  There's currently no way, as far as I can tell, to show images inline.

This might involve some work in each message theme :(
You can show images inline, and here's how (though this is merely a workaround and by no means a fix for the general issue):
You need to allow img tags in messages:
> // Call to createDerivedRuleset so the global ruleset gets inited
> createDerivedRuleset();
> // Allow images in IM messages
> addGlobalAllowedTag("img");
> addGlobalAllowedAttribute("src");

And then you just insert <img> tags into the displayMessage property of the imIMessage you get in prepareForDisplaying. You might also want to allow other attributes like "alt" or style rules like "vertical-align".
This will "compromise" all chats from what I can tell, so it is by no means what I'd call safe.
What I forgot: the filter list modification methods are from resource:///modules/imContentSink.jsm. And here's a screenshot of images embedded in messages: http://i.imgur.com/DG27WwC.png
Mic had WIPs about this several years ago, maybe there's something attached to an old bug.

Martin, yes you want to do something to the filtering rules, but you certainly don't want to do it globally. Derived rulesets should let you allow a specific tag (and allow the src attribute specifically on that tag, and preferably with only some URL schemes) only on some conversations.
(In reply to Florian Quèze [:florian] [:flo] from comment #3)
> Mic had WIPs about this several years ago, maybe there's something attached
> to an old bug.

That was bug 955011, there's no code attached there...only mockups and screenshots.
See Also: → bug 955011
You need to log in before you can comment on or make changes to this bug.