Adium

Ticket #10659 (new defect)

Opened 2 years ago

Last modified 12 months ago

Many old messagestyle have broken emoticon/alt switching

Reported by: mathuaerknedam Owned by:
Milestone: Adium bugs Component: Message View
Version: 1.3svn Severity: normal
Keywords: emoticon click Cc:
Patch Status:

Description

In many messagestyles with a custom template.html, clicking on an emoticon properly swaps with the alt text, but clicking on that alt text improperly displays the webkit missing image icon.

I suspect that virtually all of these messagestyles started as a copy (or a copy of a copy of a copy...) of an early version of Smooth Operator that included its own Template.html. (If I remember correctly, it was initially required for each messagestyle to have it's own Template.html). At this point, I don't know if these messagestyles worked correctly when they were created or if they were broken from the start, but I'm tending to think the former is more likely. Maybe these were created before the emoticon/alt-text swap feature was added?  Sharp is one example of a messagestyle displaying this brokenness.

I'm not sure what to do with this, but I discusses it with CFM on IRC and he thought it might be worthwhile to have a ticket.

Attachments

Adium_2008-08-28-140224_junjudee.crash (29.4 KB) - added by mathuaerknedam 2 years ago.

Change History

Changed 2 years ago by evands

Can you look at the swap function in a working style and in a broken one and point out the difference(s)?

Changed 2 years ago by jas8522

  • milestone set to Needs feedback from users

Changed 2 years ago by Robby

  • pending changed from 0 to 1

Changed 2 years ago by mathuaerknedam

  • pending changed from 1 to 0

I'll look into it. Sorry for the delay, I never saw the email update.

Changed 2 years ago by mathuaerknedam

  • milestone Needs feedback from users deleted

The 1.3 release Template.html contains:

		function imageSwap(node) {
			var shouldScroll = nearBottom();

			//Swap the image/text
			var img = document.createElement('img');
			img.setAttribute('src', node.getAttribute('src'));
			img.setAttribute('alt', node.firstChild.nodeValue);
			img.className = node.className;
			node.parentNode.replaceChild(img, node);
			
			alignChat(shouldScroll);
		}

The Template.html in Sharp.adiummessagestyle contains:

		function imageSwap(node) {
			img = document.createElement('img');
			img.setAttribute('src', node.src);
			img.setAttribute('alt', node.firstChild.nodeValue);
			node.parentNode.replaceChild(img, node);
			alignChat();
		}

If I use the current functions with the old Template.html there is a minor improvement in Sharp. Clicking on an emoticon still convert it to it's alt-text, but now clicking on the alt text does nothing (and it does not appear to be clickable). Better than appearing clickable and getting a broken image icon! Each Template.html also contains a different document.onclick = imageCheck; function imageCheck(){..., but changing this does not affect behavior.

Surprisingly, a wholesale replacement of Sharp's Template.html with the one found in the WebKit Message View plugin will completely break the messagestyle to the degree that Adium segfaults if I open the messages prefpane when sharp is active. I'll attach the crashlog for that.

Removing Sharp's Template.html breaks Sharp completely, because its Info.plist does not contain a MessageViewVersion key and this key is required for any messagestyle that does not have an embedded Template.html.

After removing Sharp's embedded Template.html, setting mvv=0 does not help, but setting mvv=1 completely resolves the issue.

I suspected that the combination of replacing the contents of the embedded Template.html with the release version, in combination with adding any valid mvv key, would also work. Interestingly, in this combination mvv<3 segfaulted but mvv=3 or =4 resolved the issue.

Since AIWebkitMessageViewStyle.m (as far as I can tell) both checks for a custom Template.html and treats legacy messageview versions (<3) differently, I'll guess that the culprit is somewhere in there. Unfortunately, I neither know where else to look nor understand the code enough to delve deeper.

Changed 2 years ago by mathuaerknedam

Changed 2 years ago by jas8522

  • milestone set to Adium 1.3.x

Changed 22 months ago by jas8522

  • milestone changed from Adium 1.3.x to Adium bugs

Changed 19 months ago by evands

I can't figure out why the behavior described happens, but I have confirmed it... the current, working functions lead to old message styles not letting you click the text back into the image.

Changed 19 months ago by evands

(In [25782]) Improve (but don't fix) the emoticon/alt image switching in certain styles with custom template.html files. Please see #10659 for all the details. Refs #10659

Changed 19 months ago by evands

(In [25784]) Merged [25782]: Improve (but don't fix) the emoticon/alt image switching in certain styles with custom template.html files. Please see #10659 for all the details. Refs #10659

Changed 12 months ago by Robby

  • keywords emoticon click added
  • summary changed from many old messagestyle have broken emoticon/alt switching to Many old messagestyle have broken emoticon/alt switching

Changed 12 months ago by Robby

Ticket #12446 has been marked as a duplicate of this ticket.

Changed 12 months ago by Robby

Ticket #12756 has been marked as a duplicate of this ticket.

Note: See TracTickets for help on using tickets.