Index: class-wp-xmlrpc-server.php
===================================================================
--- class-wp-xmlrpc-server.php	(revision 16337)
+++ class-wp-xmlrpc-server.php	(working copy)
@@ -63,6 +63,7 @@
 			'wp.getCommentStatusList' => 'this:wp_getCommentStatusList',
 			'wp.getMediaItem'		=> 'this:wp_getMediaItem',
 			'wp.getMediaLibrary'	=> 'this:wp_getMediaLibrary',
+			'wp.getPostFormats'		=> 'this:wp_getPostFormats',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1602,6 +1603,40 @@
 		return $attachments_struct;
 	}
 
+	/**
+	 * Retrives a list of post formats used by the site
+	 *
+	 * @since 3.1.0
+	 *
+	 * @param array $args Method parameters. Contains:
+	 *  - blog_id
+	 *  - username
+	 *  - password
+	 * @return array
+	 */
+	 function wp_getPostFormats($args) {
+	 	$this->escape($args);
+		
+		$blog_ID = (int) $args[0];	// we will support this in the near future
+		$username = $args[1];
+		$password = $args[2];
+		
+		if ( !$user = $this->login($username, $password) )
+			return $this->error;
+			
+		do_action('xmlrpc_call', 'wp.getPostFormats');
+		
+		$post_formats = array();
+		
+		$strings = get_post_format_strings();
+		foreach ( $strings as $format ) {
+			$post_formats['postFormatSlug'] = $format[0];
+			$post_formats['postFormatName'] = $format[1];
+		}
+		
+		return $post_formats;
+	 }
+
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
@@ -2266,6 +2301,12 @@
 		$this->add_enclosure_if_new($post_ID, $content_struct['enclosure']);
 
 		$this->attach_uploads( $post_ID, $post_content );
+		
+		// Handle post formats if assigned
+		if ( isset($content_struct["wp_post_format"]) ) {
+			$format = sanitize_key( $content_struct["wp_post_format"] );
+			wp_set_post_terms( $post_ID, array('post-format-' . $format), 'post_format' );
+		}
 
 		logIO('O', "Posted ! ID: $post_ID");
 
@@ -2552,6 +2593,12 @@
 		$this->add_enclosure_if_new($post_ID, $content_struct['enclosure']);
 
 		$this->attach_uploads( $ID, $post_content );
+		
+		// Handle post formats if assigned
+		if ( isset($content_struct["wp_post_format"]) ) {
+			$format = sanitize_key( $content_struct["wp_post_format"] );
+			wp_set_post_terms( $post_ID, array('post-format-' . $format), 'post_format' );
+		}
 
 		logIO('O',"(MW) Edited ! ID: $post_ID");
 
@@ -2619,6 +2666,9 @@
 			// Consider future posts as published
 			if ( $postdata['post_status'] === 'future' )
 				$postdata['post_status'] = 'publish';
+				
+			// Get post format
+			$post_format = get_post_format( $post_ID );
 
 			$sticky = false;
 			if ( is_sticky( $post_ID ) )
@@ -2660,6 +2710,7 @@
 				'date_created_gmt' => new IXR_Date($post_date_gmt),
 				'post_status' => $postdata['post_status'],
 				'custom_fields' => $this->get_custom_fields($post_ID),
+				'wp_post_format' => $post_format,
 				'sticky' => $sticky
 			);
 
@@ -2740,6 +2791,9 @@
 			// Consider future posts as published
 			if ( $entry['post_status'] === 'future' )
 				$entry['post_status'] = 'publish';
+				
+			// Get post format
+			$post_format = get_post_format( $entry['ID'] );
 
 			$struct[] = array(
 				'dateCreated' => new IXR_Date($post_date),
@@ -2763,7 +2817,8 @@
 				'wp_author_display_name' => $author->display_name,
 				'date_created_gmt' => new IXR_Date($post_date_gmt),
 				'post_status' => $entry['post_status'],
-				'custom_fields' => $this->get_custom_fields($entry['ID'])
+				'custom_fields' => $this->get_custom_fields($entry['ID']),
+				'wp_post_format' => $post_format				
 			);
 
 		}
