src/mist_api_sandbox.c
void mist_sandbox_remove_peers_by_uid(mist_api_t* mist_api, const char* uid) {
    sandbox_t* sandbox;
    bool removed = false;

    LL_FOREACH(mist_api->sandbox_db, sandbox) {
        sandbox_peers_t* elt;
        sandbox_peers_t* tmp;
        LL_FOREACH_SAFE(sandbox->peers, elt, tmp) {
            if (memcmp(uid, elt->peer.ruid, 32) == 0) {
                LL_DELETE(sandbox->peers, elt);
                removed = true;
                wish_platform_free(elt);
            }
        }
    }
    
    if (removed) { sandbox_signals_emit(mist_api, "peers"); }
    
    sandbox_save(mist_api);
}
/**
 * Remove all peers from all sandboxes with ruid equal to given uid
 * 
 * @param mist_api
 * @param uid
 */
Remove all peers from all sandboxes with ruid equal to given uid

@param mist_api
@param uid
Remove all peers from all sandboxes with ruid equal to given uid @param mist_api @param uid
void mist_sandbox_remove_peers_by_uid(mist_api_t* mist_api, const char* uid) {
    sandbox_t* sandbox;
    bool removed = false;
    LL_FOREACH(mist_api->sandbox_db, sandbox) {
        sandbox_peers_t* elt;
        sandbox_peers_t* tmp;
        LL_FOREACH_SAFE(sandbox->peers, elt, tmp) {
            if (memcmp(uid, elt->peer.ruid, 32) == 0) {
                LL_DELETE(sandbox->peers, elt);
                removed = true;
                wish_platform_free(elt);
            }
        }
    }
    if (removed) { sandbox_signals_emit(mist_api, "peers"); }
    sandbox_save(mist_api);
}
void mist_sandbox_remove_peers_by_uid ( mist_api_t * mist_api , const char * uid ) { sandbox_t * sandbox ; bool removed = false ; LL_FOREACH ( mist_api -> sandbox_db , sandbox ) { sandbox_peers_t * elt ; sandbox_peers_t * tmp ; LL_FOREACH_SAFE ( sandbox -> peers , elt , tmp ) { if ( memcmp ( uid , elt -> peer . ruid , 32 ) == 0 ) { LL_DELETE ( sandbox -> peers , elt ) ; removed = true ; wish_platform_free ( elt ) ; } } } if ( removed ) { sandbox_signals_emit ( mist_api , " " ) ; } sandbox_save ( mist_api ) ; }
Remove all peers from all sandboxes with ruid equal to given uid
Remove all peers from all sandboxes with ruid equal to given uid