mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 02:46:21 +00:00
Add /avatar set command to publish avatar
Use `/avatar set <path>` where <path> is an image file to upload a new avatar for the current user. When the avatar is too big it gets scaled down. Scaling code copied from dino. Fixes https://github.com/profanity-im/profanity/issues/1687
This commit is contained in:
@@ -1057,6 +1057,7 @@ cmd_ac_init(void)
|
||||
autocomplete_add(correction_ac, "char");
|
||||
|
||||
avatar_ac = autocomplete_new();
|
||||
autocomplete_add(avatar_ac, "set");
|
||||
autocomplete_add(avatar_ac, "get");
|
||||
autocomplete_add(avatar_ac, "open");
|
||||
|
||||
@@ -4101,6 +4102,11 @@ _avatar_autocomplete(ProfWin* window, const char* const input, gboolean previous
|
||||
|
||||
jabber_conn_status_t conn_status = connection_get_status();
|
||||
if (conn_status == JABBER_CONNECTED) {
|
||||
result = cmd_ac_complete_filepath(input, "/avatar set", previous);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_func(input, "/avatar get", roster_barejid_autocomplete, previous, NULL);
|
||||
if (result) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user