<?php
/**
 * @file
 * Install, update and uninstall functions for the twitter module.
 *
 */

/**
 * Implements hook_uninstall().
 */
function twitter_post_uninstall() {
  variable_del('twitter_post_types');
  variable_del('twitter_post_default_format');
  variable_del('twitter_post_default_value');
}

/**
 * Don't default to TinyURL any more.
 */
function twitter_post_update_7300() {
  if (variable_get('twitter_post_default_format', NULL) == 'New post: !title !tinyurl') {
    variable_set('twitter_post_default_format', "New post: !title !url-alias");
  }
  return t('Twitter Post now defaults to using aliases, not TinyURL.');
}

/**
 * Implements hook_update_N().
 *
 * Increase module weight to run after pathauto.
 */
function twitter_post_update_7301() {
  db_update('system')
    ->fields(array(
      'weight' => 10,
    ))
    ->condition('name', 'twitter_post', '=')
    ->execute();
  return t('Updated system weight to 10 for Twitter Post.');
}
