Miranda IM

Results 1 to 5 of 5

Thread: Looking for plugin coding help....

  1. #1

    Looking for plugin coding help....

    I want to build a plugin that integrates the Prowl API's into miranda.

    For example, if I receive an instant message and my protocol status is AWAY then I'd like to format the message and send it to my iPhone via the prowl API.

    There are a couple of ways to do this:
    1 - Use the .Net prowl api's from http://prowl.weks.net/api.php and http://prowldotnet.codeplex.com/ to build a "real" miranda plugin .dll.

    2 - Build a miranda plugin that is able to pass the contact name, message, and date/time the message was received off to a batch file. Then in this batch file I could use any of the prowl API's (perl, for example) to send the message to my iPhone.

    I am clueless on how to write such a plugin as I have never tried a miranda plugin before. I looked at the mBot plugin and that worked but it is old and probably will not be recompile for MIM v9 and x64.

    I am thinking of something that starts like the tiggerplugin, messagenotify plugin, or even the FDD notify plugin but is modified to do a different action.

    Ideally I see the plugin letting me pick which protocol(s) and which status(s) to trigger the sending of the message to prowl. For example, for the jabber protocol if I am in the away status the sent the message to prowl.

    Is anyone up to the challenge to help me build this?

  2. #2
    I decided to try it myself. It took a while to figure out the plugin format but seem to have gotten a very simple growl plugin working for miranda v9 x64.

    Basically the plugin detects if a message arrives to an account that is in AWAY or NA status then it passes the contact name and text of the message to the growlnotify program. Using growlnotify I can then use growl for windows to forward that to email or an iphone push notifications. It works well.

    I'd like to add some customization to the plugin though. This requires building an options page and I just can't figure that out. I've reviewed the existing plugins and just cannot get anything working.

    Does anyone have a very simple example of how to create an options dialog box and save settings?

    I know I have to hook to ME_OPT_INITIALISE and that this calls a function. I create the following:

    HookEvent(ME_OPT_INITIALISE, HSOptInitialise);

    which calls:

    int HSOptInitialise(WPARAM wParam,LPARAM lParam)
    {
    OPTIONSDIALOGPAGE odp = {0};

    odp.cbSize = sizeof(odp);
    odp.position = 100100000;
    odp.hInstance = hInst;
    odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORYSWEEPER);
    odp.pszTitle = ModuleName;
    odp.pszGroup = "History";
    odp.pfnDlgProc = DlgProcHSOpts;
    odp.flags = ODPF_BOLDGROUPS;

    CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);

    return 0;
    }

    I am lost from here though.

    How do I:
    1 - I need a resource file but how do I create this?
    2 - What is the code for the DlgProcHSOpt() function?
    3 - How do I display the options dialog box when the option is selected?

    Any suggestions would be appreciated.

  3. #3
    Join Date
    June 2005
    Posts
    11,839
    Quote Originally Posted by mlcampbe View Post
    1 - I need a resource file but how do I create this?
    With the resource editor, if you are using Express version it's not included.
    Quote Originally Posted by mlcampbe View Post
    2 - What is the code for the DlgProcHSOpt() function?
    The code your dialog needs, there you will put the code to display and save options.
    Quote Originally Posted by mlcampbe View Post
    3 - How do I display the options dialog box when the option is selected?
    Miranda will do it for you: IDD_OPT_HISTORYSWEEPER - is supposed to be options dialog template id, and DlgProcHSOpts is window procedure.

  4. #4
    Ok, I guess I understand this much but what is the code that I need in the DlgProcHSOpt() function?What is a simple example? If I could get an example of a simple resource form that had a checkbox or 2 and the code for DlgProcHSOpt() that would be helpful to see how to start. All of the existing plugins I review has a lot of code in the DlgProcHSOpt() function.

  5. #5
    I think my suggestion here: http://forums.miranda-im.org/showthr...ted-developers is the most viable way. Protocol should be independent from popup displaying plugin implementation or plugin will be a hell to support.

Similar Threads

  1. Coding characters
    By Hedo in forum Technical Support
    Replies: 1
    Last Post: 16 Oct 2007, 3:27 PM
  2. ICQ message coding
    By evalduxx in forum Technical Support
    Replies: 1
    Last Post: 15 Apr 2007, 9:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •