mirror of
https://github.com/haiwen/ccnet-server.git
synced 2025-09-17 23:38:54 +00:00
Use transaction when creating a new group.
De-duplicate in getting groups with ancestors.
This commit is contained in:
@@ -834,7 +834,7 @@ ccnet_db_rollback (CcnetDBTrans *trans)
|
||||
DBConnection *conn = trans->conn;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!db_connection_commit (conn, &error)) {
|
||||
if (!db_connection_rollback(conn, &error)) {
|
||||
ccnet_warning ("Rollback failed: %s.\n", error->message);
|
||||
g_clear_error (&error);
|
||||
return -1;
|
||||
|
@@ -1145,7 +1145,7 @@ ccnet_rpc_quit_group (int group_id, const char *user_name, GError **error)
|
||||
}
|
||||
|
||||
GList *
|
||||
ccnet_rpc_get_groups (const char *username, gboolean return_ancestors, GError **error)
|
||||
ccnet_rpc_get_groups (const char *username, int return_ancestors, GError **error)
|
||||
{
|
||||
CcnetGroupManager *group_mgr =
|
||||
((CcnetServerSession *)session)->group_mgr;
|
||||
@@ -1157,7 +1157,8 @@ ccnet_rpc_get_groups (const char *username, gboolean return_ancestors, GError **
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = ccnet_group_manager_get_groups_by_user (group_mgr, username, return_ancestors, error);
|
||||
ret = ccnet_group_manager_get_groups_by_user (group_mgr, username,
|
||||
return_ancestors ? TRUE : FALSE, error);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -213,7 +213,7 @@ int
|
||||
ccnet_rpc_quit_group (int group_id, const char *user_name, GError **error);
|
||||
|
||||
GList *
|
||||
ccnet_rpc_get_groups (const char *username, gboolean return_ancestors, GError **error);
|
||||
ccnet_rpc_get_groups (const char *username, int return_ancestors, GError **error);
|
||||
|
||||
GList *
|
||||
ccnet_rpc_get_all_groups (int start, int limit, const char *source, GError **error);
|
||||
|
Reference in New Issue
Block a user