You are here

function messaging_twitter_messaging in Messaging 6.4

Same name and namespace in other branches
  1. 6 messaging_twitter/messaging_twitter.module \messaging_twitter_messaging()
  2. 6.2 messaging_twitter/messaging_twitter.module \messaging_twitter_messaging()
  3. 6.3 messaging_twitter/messaging_twitter.module \messaging_twitter_messaging()

Implementation of hook_messaging

File

messaging_twitter/messaging_twitter.module, line 14
Messaging Twitter sending method

Code

function messaging_twitter_messaging($op = 'info') {
  switch ($op) {
    case 'send methods':
      $info['twitter_dm'] = array(
        'title' => t('Twitter Direct Message'),
        'name' => t('Twitter Direct Message'),
        'group' => 'twitter',
        'address_type' => 'twitter',
        // Which kind of address this method uses
        'type' => MESSAGING_TYPE_SEND,
        'glue' => ' ',
        'description' => t("Send as a Twitter direct message."),
        'send callback' => 'messaging_twitter_send_dm',
        'system accounts' => TRUE,
        // Supports multiple sending accounts
        'account type' => 'twitter',
      );
      $info['twitter_at'] = array(
        'title' => t('Twitter @ Message'),
        'name' => t('Twitter @ Message'),
        'group' => 'twitter',
        'address_type' => 'twitter',
        'type' => MESSAGING_TYPE_SEND,
        'glue' => ' ',
        'description' => t("Send as a Twitter @ message."),
        'send callback' => 'messaging_twitter_send_at',
        'system accounts' => TRUE,
        // Supports multiple sending accounts
        'account type' => 'twitter',
      );
      return $info;
    case 'address types':
      $info['twitter'] = array(
        'name' => t('Twitter account'),
        // Name of the address for this method
        'user2address callback' => 'messaging_twitter_user_destination',
      );
      return $info;
  }
}