Shoutbox

Hide send / received message - 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: Hide send / received message (/showthread.php?tid=90389)

Hide send / received message by Hen on 04-27-2009 at 10:09 PM

Hi,
Is there a way to hide an antire incoming message inside an active chat window when I am receiving one
Same for outgoing - Is there a way to write a message, prees "enter", send the message but it wont appear as a new line in the chat window?
Thank!
Hen.


RE: Hide send / received message by Hen on 04-30-2009 at 07:51 PM

Hi,
It is very rare here to receive zero replies....
Is it impossible or is it too simple that no one replied ... :-)   ?

I want that when a message is received and has a certain content, it wil be ignored and not presented on the screen.
You can change each character from "Message to be ignored" to blank characters, but then you will still have the "XX says:", which might by annoying if the same message repeats too many times.

Have any idea?

Thanks,
Hen.


RE: Hide send / received message by Baggins on 04-30-2009 at 08:10 PM

Yes this is very possible, I think the lack of replies was because you weren't very clear about what you wanted. Since what you are asking is still vague I'm just going to say that you will need to use the functions OnEvent_ChatWndReceiveMessage and OnEvent_ChatWndSendMessage then detect if the message is one you wanted removed. If it is then you will return an empty string, and if it isn't then you will just return the original message.


RE: RE: Hide send / received message by Hen on 04-30-2009 at 08:30 PM

Hi,

quote:
Originally posted by Baggins
I think the lack of replies was because you weren't very clear about what you wanted.... If it is then you will return an empty string, and if it isn't then you will just return the original message.

I try again with an example
Hani and Baggins chat in a conversation window.
Hani send Baggins the message: "Bla bla".
Nothing happens on Baggins screen,
and... - when Hani pressed enter, also it seemed like he never sent that message - "Hani says: Bla bla" never appeared on his screen also.

Using the "OnEvent_ChatWndReceiveMessage" and replacing the "Bla bla" with blank characters will show a new line "Hani says: " no?
and then if I keep on saying "bla bla" it will make a lot of new empty lines on your computer, no? - and I want to avoid it.

Did I sucess clarifying my question?
Can I do that?
Thanks!
RE: Hide send / received message by Baggins on 04-30-2009 at 08:31 PM

You can make your messages not show up on either screen but you can only make the other person's messages not show up on your screen.
EDIT: Instead of replacing them with blank characters, just remove them.


RE: RE: Hide send / received message by Hen on 04-30-2009 at 08:44 PM

Hi,
did you mean for - "ChatWnd::EditText" ?
If I check the content of the sent message, and then return "", then it really doesn't show the words on screen, but did the original message was sent?
I dont want to show the sent message on both computers, but I do want to send it. (if the message was received the script will do something, but will not show the received message)
Thanks.


RE: Hide send / received message by CookieRevised on 05-01-2009 at 04:08 AM

Hen, it is not possible to do _exactly_ what you want.

You can only change the text which is recieved in your own chat window, thus not on the contact's side. And it can't be longer than the original recieved text (not a problem your case). But also, you can not completely discard it as in not showing anything; there will always be a line shown, albite it may be an empty line.

Also remember, if you modify the sent text, then the modified text is send, not the thing you originally typed (scripts parse the sent text before it is actually send to your contacts). To put it very simply: If you type "Hello World" and a script changes that text to "BlahBlah" then "BlahBlah" will be send to your contact.

Note also that the text you've send will again be recieved (almost instantly) by you too.

Putting things together (in an very easy way; thus far from foolproof):

js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
    if (MsgKind === 1 | MsgKind === 6) {
        if (Message === "/DoTheMacarena") {
            if (Origin === Messenger.MyName){
                Debug.Trace("command send")
            } else {
                Debug.Trace("command received")
            }
            return ""
        }
    }
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if (Message = "Hello World") {
        return "/DoTheMacarena"
    }
}
- If the user types "Hello World", then the command "/DoTheMacarena" is send to your contact (your contact WILL see "/DoTheMacarena").
- Since you also recieve your own sent text, the command "/DoTheMacarena" will be send to you also. And thus it is in the RecievedMessage event that you can change the _displayed_ text to an empty line.
But note that this changed displayed text is only on YOUR side. And also note that there will be a line shown, eventhough you changed the text to an empty line; you can not discard it or hide the chat line completely.

---

I very very strongly suggest to read the help that comes with the scripting engine and especially the help about the two events shown above (choose "Scripting Documentation" from the "Files" menu in the script editor).







---------

quote:
Originally posted by Hen
It is very rare here to receive zero replies....
Is it impossible or is it too simple that no one replied ... :-)
Not really, there are a lot of threads with no replies. Anyways, be more patient. This forum is very active, as you know, which means a lot of threads are created all the time, meaning an older message will quickly drop down the list of new threads. Give it a few more days (instead of just 1) in the futur... Also, on this forum it is custom to not reply with stuff like "I don't know". So people who don't know or can't answer a question will not spam a thread with non-helpfull posts; doesn't mean your post isn't read though.

;)
RE: Hide send / received message by Hen on 05-01-2009 at 09:31 AM

Hi,
Thanks.
It was  a very thorough response.

Can we solve this in a different approach? :
When I click on "video" in a chat conversation, a request is send to my contact, and no message is written in the message line.
Can we mimic this?
Can I define a new command in the script, both me and my contact will have the script, and then I will actually send him a command and not a message, thus maybe we can make it invisible in the message line?
For instance, i will send the Messenger.StartVideo(Contact) command, only it will be a different command, one that I will make up (not part of Messenger API).

Regarding the zero replies - it came from a positive point of view, as I appreciate the short time it usually takes to ppl here to reply, almost about everything.
Cheers,
Hen.


RE: RE: Hide send / received message by CookieRevised on 05-04-2009 at 04:19 AM

quote:
Originally posted by Hen
When I click on "video" in a chat conversation, a request is send to my contact, and no message is written in the message line.
Can we mimic this?
You can (see your other thread) for most existing menu items.

quote:
Originally posted by Hen
Can I define a new command in the script, both me and my contact will have the script, and then I will actually send him a command and not a message, thus maybe we can make it invisible in the message line?
Nope...

PS: a normal text message is also a "command" as you call it ("communication protocol message" would be a more accurate description). It simply is a series of "commands" to show some text in the chat window. But you can't invent new "commands" which don't exist yet*.

* Actually, in theory, you can, but that would be tampering with the underlying communication protocol and it would require you to be able to send and recieve raw protocol messages, meaning you need a proxy, which is not possible in Plus! scripting for obvious security and stability reasons... Also, both your Messenger and the Messenger of your contacts need to be able to recieve those 'new' commands and thus need to be altered.... so in short: no, you can't
RE: Hide send / received message by Hen on 05-11-2009 at 02:20 PM

Hi all,
Just wanted to say thank you for your replies and help, for both of the threads.
I downloaded the program, and its really cool.
I guess that if I will deapen with this one, I'll post some more questions.
Have a great weekend.
Hen.