Is there a way to know if a post has been published through XML-RPC?

You could use a custom field for a post which is saved via XMLRPC by using the action hook xmlrpc_publish_post. wpse_from_xmlrpc() could than check this custom field.

<?php
    add_action( 'xmlrpc_publish_post', 'add_xmlrpc_postmeta' );
    function add_xmlrpc_postmeta( $post_id ){
        update_post_meta( $post_id, 'send-by-xmlrpc', 1 );
    }

    function wpse_from_xmlrpc( $post_id ){
        $xmlrpc = get_post_meta( $post_id, 'send-by-xmlrpc', true );
        if( $xmlrpc == 1 )
            return true;
        return false;
    }
?>

More information on this hook can be found in wp-includes/post.php