Shoutbox

Emoticons disappear! - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Emoticons disappear! (/showthread.php?tid=62237)

Emoticons disappear! by noroom on 07-01-2006 at 12:30 PM

When a script tries to send a message using the ChatWnd.SendMessage() method, all the smileys in the edit box are replaced by a space.

How can I make a script send text without ruining what the user is typing?


RE: Emoticons disappear! by RaceProUK on 07-01-2006 at 01:58 PM

It's due to the emoticon auto-replace, and sounds like a limitiation to me.


RE: Emoticons disappear! by noroom on 07-01-2006 at 06:01 PM

But for example, messages sent to the conversation window preserve emoticon shortcuts when you press Ctrl+Up to review sent messages.
Also, when I use the /all command, Plus! does send emoticons to all windows. It seems like Plus! really can read the emoticons that are in the conversation window.

Why can't it restore them? Or at least replace them with the emoticon shortcut text again?


RE: Emoticons disappear! by deAd on 07-01-2006 at 07:24 PM

Plus! sends messages by adding text to the conversation window's textbox and simulating the enter key's press. This is how it sends custom emoticons.

If there is text in the box when it sends it, it copies it and pastes it back in after it's sent.

Because the auto-replaced emoticons are images, they come out as a space. This is normal.

However, when the user presses "send", messenger sends it all as text, and sends the images separately in what the protocol calls a "MSN Object".

This way, Plus! can see what the emoticon shortcuts are.

Answer to your question: It can't restore them because it just copy/pastes the text. Try this manually, the emoticons will be replaced with spaces. It can't get the shortcut text because the box contains images, and since it's not being sent, you can't do that.

An alternative to your problem, though not a very good one, is to log what the user types into a variable using the edit key pressed event. Then, use SendMessage, and after that's sent, set the edit text to the variable. This will set it to what plus sets it to, but since it checks it key-by-key (instead of copying it all at one time), the emoticon shortcuts will be preserved.


RE: Emoticons disappear! by noroom on 07-01-2006 at 07:34 PM

quote:
Originally posted by deAd
It can't get the shortcut text because the box contains images, and since it's not being sent, you can't do that.
Then how is it able to tell what emoticon I typed when I use the /all command? It correctly sends the emoticon I typed to all my open converstations. Or the /name command? It correctly sets the emoticon in my Display Name.

Plus! seems to be able to get the emoticons (custom or standard, it doesn't matter) in so many situations, why is it that it can't do it in this case?
RE: Emoticons disappear! by RaceProUK on 07-01-2006 at 11:43 PM

I believe it's because, with /all, Plus! is able to access the MSN Objects, as the message is fully formed when Send is pressed.


RE: Emoticons disappear! by noroom on 07-02-2006 at 08:50 AM

What is a "fully formed" message?


RE: Emoticons disappear! by mathieumg on 07-02-2006 at 12:08 PM

Emoticons and formatted text already parsed.


RE: Emoticons disappear! by noroom on 07-02-2006 at 04:55 PM

Isn't a message always "fully formed"? Emoticons get parsed as soon as they're typed in.

Where's Patchou? :(


RE: Emoticons disappear! by Patchou on 07-02-2006 at 05:57 PM

Fixed, thanks for reporting :)


RE: Emoticons disappear! by luisillo on 07-02-2006 at 07:01 PM

I donīt understand completely the mistake.
When I use ChatWnd.SendMessage(";ico15"); my contact receives the icon I have associated to that text, or you mean having some text written in the ChatWindow textarea and when executing a script causes your icons to disappear?


RE: RE: Emoticons disappear! by noroom on 07-03-2006 at 11:01 AM

quote:
Originally posted by Patchou
Fixed, thanks for reporting :)

Ah SWEET! You're welcome. (Y)

@luisillo: Type in "Hello :) " to a contact but don't send it. Then have a script send a message in that window using the SendMessage() method. The message will get sent, and what you had typed will reappear in the edit box, only the smiley will be gone.