docs: def _adium_status(status, message):
      """ Updates status and message for Adium IM application.
  
          `status`
              Status type.
          `message`
              Status message.
          """
  
      # map status code
      code = ADIUM_CODE_MAP[status]
  
      # get message
      if not message:
          default_messages = {
              'busy': 'Busy',
              'long_away': 'Extended away'
          }
          message = default_messages.get(status, '')
      else:
          message = message.replace('"', '\\"')  # escape message
  
      # build applescript
      #  if adium is running:
      #  * set status
      #  * also set status message, if provided
      script = """
       tell application "System Events"
        if exists process "Adium" then
         tell application "Adium" to go {0}""".format(code)
  
      if message:
          # set status message
          script += ' with message "{0}"'.format(message)
  
      script += """
        end if
       end tell"""
  
      # run it
      common.shell_process(['osascript', '-e', script])