The Application Toolbar module: http://drupal.org/project/appbar has an alerts system that I would like to be able to send messages out of.

Any chance of getting it integrated with messaging?

Thanks.

Comments

icecreamyou’s picture

Issue tags: +Appbar

Hi, I'm the maintainer of Appbar. This is something I would like to see as well. I may even be able to write it at some point, although I don't have the time to put into it right now.

icecreamyou’s picture

Version: 6.x-2.x-dev » 6.x-4.x-dev

...

jose reyero’s picture

Sounds interesting.

I think the better way, to save one more module would be to add some messaging hook into AppBar, it should be as simple as this:

/**
 * Implementation of hook_messaging
 */
function appbar_messaging($op = 'info') {
  switch ($op) {
    case 'send methods':
      $info['appbar'] = array(
        'title' => t('Appbar'),
        'name' => t('Appbar'),
        'group' => 'web',
        'address_type' => 'user', // Which kind of address this method uses
        'type' => MESSAGING_TYPE_SEND,
        'description' => t('Appbar'),
        'send callback' => 'appbar_messaging_send_msg',
        'anonymous' => FALSE, // This method is not valid for anonymous users

        // Then there are some formatting options, may not be needed
        'glue' => '<br />',
        'filter' => 'messaging_filter',
        'format' => 'HTML',
      );
      return $info;
  }
}

Then we just need to implement the 'send callback' specified above:

function appbar_messaging_send_msg($uid, $message) {
   // You can use these functions to retrieve the message parts
   $message->get_subject();
   $message->get_body();
  .....
  return TRUE; // Meaning the message was sent successfully
}

This should work with the advantage that it does nothing if messaging not enabled. However if you are unsure about whether you want to have this into your module we can add one more module with just this code.

icecreamyou’s picture

Committed. Thanks Jose.

jose reyero’s picture

Wow, that was fast. Hope you've tested it before :-)

Anyway, let me know whether it works so I can add a link to Messaging home page.

icecreamyou’s picture

Yep, tested against 4.x. :)

jose reyero’s picture

Status: Active » Fixed

Sounds like this is done. I've added a note on the project page too.

icecreamyou’s picture

Awesome, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Appbar

Automatically closed -- issue fixed for 2 weeks with no activity.