-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add XEP-0054 vCard support #1757
Conversation
@mdosch can you test whether it behaves like you imanged when you opened the issue? |
I tried out requesting vcards and this are my findings:
|
Thanks |
c7dc068
to
e338da5
Compare
"/vcard refresh", | ||
"/vcard save") | ||
CMD_DESC( | ||
"Read your vCard or a user's vCard, get a user's avatar via their vCard, or modify your vCard. If no arguments are given, your vCard will be displayed in a new window, or an existing vCard window.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to change Read your vCard (XEP-XXXX)
so that the experienced user knows which vcard XEP is used?
I didn't read the corresponding XEPs yet.
Not sure which one is more up to date and whether later we will just leave the same command but use another XEP in the background.
@mdosch any opinion on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdosch ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review looks good! Thanks for your work!
I added some comments/questions.
Also:
Did you test the new functionality with valgrind to check for any leaks? It's described here: https://github.com/profanity-im/profanity/blob/master/CONTRIBUTING.md
If you need any help about that, please let me know.
Yes, I have. Thankfully the only memory leaks I found were with the |
cmd_vcard_photo(ProfWin* window, const char* const command, gchar** args) | ||
{ | ||
char* operation = args[1]; | ||
char* user = args[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we design the command to be able to get the user's own avatar
Commands like /vcard photo open
may work but /vcard photo open 4
(as in index) may conflict with the nick/contact parameter
Or /vcard photo save
but /vcard photo save filename test.png
or /vcard photo save index 4
may lead the command into thinking that it's supposed to get an avatar from a user nicknamed filename
or index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing some context.
What exactly is /vcard photo open 4
supposed to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing some context. What exactly is
/vcard photo open 4
supposed to do?
Download the avatar from a user nicknamed 4
. In some cases, this might get confused with downloading the 4th avatar from your vCard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is there a way (or should there be a way) to download multiple avatars? If yes we could just have another parameter /vcard photo open-index 4
. We have problems like this with other commands also we would need to check how we solved things there. Either by having a new (sub)command, a command with -
or reorganizing some commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we could have /vcard photo open-self [<index>]
and /vcard photo save-self [filename <filename>] [index <index>]
But is there a way (or should there be a way) to download multiple avatars? If yes we could just have another parameter
/vcard photo open-index 4
. We have problems like this with other commands also we would need to check how we solved things there. Either by having a new (sub)command, a command with-
or reorganizing some commands.
Yes, there is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we could have /vcard photo open-self [] and /vcard photo save-self [filename ] [index ]
Sounds good. And for other users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we could have /vcard photo open-self [] and /vcard photo save-self [filename ] [index ]
Sounds good. And for other users?
/vcard photo open <nick/contact> [<index>]
/vcard photo save <nick/contact> [filename <filename>] [index <index>]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
Weird, it compiled fine for me |
|
Oh, I forgot |
0bd5a66
to
3329430
Compare
AFAIK @sjaeckel plans to improve some parts of this PR with @techmetx11, so setting review on him. |
15a496a
to
a445ee9
Compare
Only nicknames, photos, birthdays, addresses, telephone numbers, emails, JIDs, titles, roles, notes, and URLs are supported Due to the synopsis array not having enough space, `/vcard photo open-self` and `/vcard photo save-self` are not documented properly in the synopsis section of the `/vcard` command, but they are documented in the arguments section Fixed memory leak in vcard autocomplete (thanks to debXwoody)
a445ee9
to
f934c5b
Compare
I don't have the time for a deeper review and I don't want to block this, so I removed myself from the reviewer list. |
Thanks for your contribution @techmetx11 |
Implemented for next release in #1757 by @techmetx11.
Only nicknames, photos, birthdays, addresses, telephone numbers, emails,
JIDs, titles, roles, notes, and URLs are supported