Use ?s= for the size of an avatar image

This is shorter in the URL and more closely matches the API used
by Gravatar, a popular avatar service that a lot of people use.

Change-Id: Iec01bb5b4c959d76effe9afe78d6644218235130
This commit is contained in:
Shawn Pearce
2013-01-17 11:29:34 -08:00
parent c219437c37
commit e8f1f811c7
2 changed files with 3 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ public class AvatarImage extends Image {
}
RestApi api = new RestApi("/accounts/" + u + "/avatar");
if (size > 0) {
api.addParameter("size", size);
api.addParameter("s", size);
}
return api.url();
}

View File

@@ -27,7 +27,8 @@ import org.kohsuke.args4j.Option;
class GetAvatar implements RestReadView<AccountResource> {
private final DynamicItem<AvatarProvider> avatarProvider;
@Option(name = "--size", usage = "size in pixels (height and width)")
@Option(name = "--size", aliases = {"-s"},
usage = "recommended size in pixels, height and width")
private int size;
@Inject