コード例 #1
0
ファイル: purple_ruby.c プロジェクト: strelok1111/purple_ruby
static VALUE set_public_alias(VALUE self, VALUE nickname)
{
  PurpleAccount *account = PURPLE_ACCOUNT(self);
  PurpleConnection *connection = NULL;
  PurplePlugin *prpl = NULL;
  const char *alias = NULL;
  void (*set_alias) (PurpleConnection *gc, const char *alias);
  
  alias = RSTRING_PTR( nickname );
  
  connection = purple_account_get_connection( account );
  
  if (!connection) {
    purple_account_set_public_alias( account, alias, NULL, NULL );
    return Qnil;
  }

  prpl = purple_connection_get_prpl( connection );
  if (!g_module_symbol( prpl->handle, "set_alias", (void *) &set_alias ) ) {
    // purple_account_set_public_alias( account, alias, NULL, NULL );
    return Qnil;
  }

  set_alias( connection, alias );
  
  return Qnil;
}
コード例 #2
0
/*
 * call-seq:
 * set_public_alias(nickname)
 *
 * Sets the public alias(nickname) of the account.
 *
 */
static VALUE set_public_alias(VALUE self, VALUE value)
{
  PurpleAccount *account;
  Data_Get_Struct(self, PurpleAccount, account);
  purple_account_set_public_alias(account, StringValueCStr(value), NULL, NULL);
  return value;
}