Miranda NG Official Community Forum

Forum for English speaking Miranda NG users => Support/Help => Topic started by: popej on 21 03 2015, 15:48:33

Title: open message window, when contact goes on-line
Post by: popej on 21 03 2015, 15:48:33
Hi,

I'm new to Miranda. I'm moving form pidgin. I have successfully configured most features but there is one problem, that I can't solve. I would like Miranda to open message window automatically, when my contact goes on-line. Is there any option or plugin to get this behavior?
Title: Re: open message window, when contact goes on-line
Post by: AnrDaemon on 23 03 2015, 03:05:38
And if your contact get a trippy connection and goes "online" every few minutes… how quick you will get annoyed by a message window popping up and interfering with your work?
Title: Re: open message window, when contact goes on-line
Post by: Robyer on 23 03 2015, 07:24:33
Maybe you can set it with ActMan plugin.
Title: Re: open message window, when contact goes on-line
Post by: popej on 23 03 2015, 11:13:38
Thanks for advices.

I have locked at ActMan but I haven't found anything related to message window or contact status change. Any suggestions how to configure ActMan plugin?
Title: Re: open message window, when contact goes on-line
Post by: Robyer on 24 03 2015, 09:52:32
I'm not using ActMan and I'm not sure if he is capable of this, but from logic of your problem you need to do this:

1) You need to hook event which is value change in Database. Key name is "Status" and it's in <proto> branch of contact settings.
2) Then check if that value is of status you want to see (offlien - 40071, online - 40072, away - 40073, ...)
3) Then start action - open message window
Title: Re: open message window, when contact goes on-line
Post by: popej on 24 03 2015, 11:41:48
I can see only limited set of hooks:
Actions/Changed - probably internal hooks of ActMan
CList/DobuleClicked
CList/PreBuildContactMenu
DB/Contact/Added
DB/Contact/Deleted

There is nothing like "Database" or "Status". Looks like a dead end for me.

This is what I'm using:
Miranda NG Version: 0.95.3 build #11706 x64 Build time: 1 Jan 2015 14:27:34
Actman.dll v.0.3.0.1 [1 Jan 2015 15:28:02] - Action manager
Title: Re: open message window, when contact goes on-line
Post by: Awkward on 24 03 2015, 12:20:43
popej, if you see limited amount of hooks in list, it not mean what you can't add there yourself, just need to check miranda API headers for what you need. events in list are just some examples in service.ini file in plugins folder.
Title: Re: open message window, when contact goes on-line
Post by: popej on 24 03 2015, 17:02:11
Thanks Awkward, I will investigate further. I haven't noticed, that I can insert other values at this field.
Title: Re: open message window, when contact goes on-line
Post by: popej on 25 03 2015, 16:00:39
I have tried to configure ActMan.
First I have added a service to services.ini, which opens message window:
Code: [Select]
[Service:CList/ContactDoubleClicked]
alias=MS_CLIST_CONTACTDOUBLECLICKED
wparam=hContact
lparam=0
return=int 0, if successful
descr=Double clicking a contact

Then I have defined following hook:
Code: [Select]
[Event:Miranda/StatusChange/ContactStatusChanged]
alias=ME_STATUSCHANGE_CONTACTSTATUSCHANGED
plugin=xStatus notify
descr='Contact status changed'
wparam=hContact
lparam=parameter

I have defined an action with 2 elements. First is a "Jump" with following condition:
Code: [Select]
Condition: Math: parameter and $63770000
Operation: Break
This is a rude attempt to check if higher part of parameters contains ID_STATUS_ONLINE.

Second element is service CList/ContactDoubleClicked with "current contact" as wParam.

The result is that Miranda hangs, when contact goes on-linine. Since I mostly have guessed how to configure ActMan, this result is not unexpected. I would appreciate any help in configuring it correctly.

Title: Re: open message window, when contact goes on-line
Post by: Awkward on 25 03 2015, 18:17:09
Slightly uncomfortable to check it for me right now. if crashlog presents, can you show it to me?
Title: Re: open message window, when contact goes on-line
Post by: Goraf on 25 03 2015, 20:20:39
It hangs so maybe..
http://wiki.miranda-ng.org/index.php?title=Using_Process_Explorer_as_the_debugging_tool
Title: Odp: open message window, when contact goes on-line
Post by: popej on 25 03 2015, 23:52:48
Miranda hangs, I kill it with process manager but I don't get crush log. This is stack window from Process Explorer:

Code: [Select]
ntdll.dll!NtWaitForSingleObject+0xa
KERNELBASE.dll!WaitForSingleObjectEx+0x9c
actman.dll!MirandaPluginInfoEx+0x1eb0
actman.dll!MirandaPluginInfoEx+0x218e

Miranda NG Version: 0.95.3 build #11706 x64 Build time: 1 Jan 2015 14:27:34
Actman.dll v.0.3.0.1 [1 Jan 2015 15:28:02] - Action manager
Title: Re: open message window, when contact goes on-line
Post by: Awkward on 26 03 2015, 05:54:31
Looks like memory allocation problem somewhere. but can't recognize place, so, will need to check (idk how yet) by myself

BTW, i published some memory fixes not so long time ago, so, maybe it was fixed already in nightly builds