summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-12-10 21:27:13 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2022-12-10 21:27:13 -0500
commitb2d53a69c4f0f01711e74f537eeaef83e13e971d (patch)
treefadc4406e4e4c20ced923609ebabcf831e07eba2
parenta66a9395e514ae5b7061be912b601bb8511d17fe (diff)
downloadlingo-b2d53a69c4f0f01711e74f537eeaef83e13e971d.tar.gz
lingo-b2d53a69c4f0f01711e74f537eeaef83e13e971d.tar.bz2
lingo-b2d53a69c4f0f01711e74f537eeaef83e13e971d.zip
Looks like the nickname field is only set if you actually have a nickname
-rw-r--r--lingo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lingo.cpp b/lingo.cpp index 3dc8b8f..1cb13ce 100644 --- a/lingo.cpp +++ b/lingo.cpp
@@ -367,10 +367,11 @@ public:
367 std::string avatar_url = event.msg.author.get_avatar_url(); 367 std::string avatar_url = event.msg.author.get_avatar_url();
368 easy.escape(avatar_url); 368 easy.escape(avatar_url);
369 std::string user_id_str = std::to_string(static_cast<uint64_t>(event.msg.author.id)); 369 std::string user_id_str = std::to_string(static_cast<uint64_t>(event.msg.author.id));
370 std::string username = event.msg.member.nickname.empty() ? event.msg.author.username : event.msg.member.nickname;
370 371
371 // Forms creation 372 // Forms creation
372 curl::curl_pair<CURLformoption,std::string> username_form(CURLFORM_COPYNAME,"username"); 373 curl::curl_pair<CURLformoption,std::string> username_form(CURLFORM_COPYNAME,"username");
373 curl::curl_pair<CURLformoption,std::string> username_cont(CURLFORM_COPYCONTENTS,event.msg.member.nickname); 374 curl::curl_pair<CURLformoption,std::string> username_cont(CURLFORM_COPYCONTENTS,username);
374 curl::curl_pair<CURLformoption,std::string> pass_form(CURLFORM_COPYNAME,"user_id"); 375 curl::curl_pair<CURLformoption,std::string> pass_form(CURLFORM_COPYNAME,"user_id");
375 curl::curl_pair<CURLformoption,std::string> pass_cont(CURLFORM_COPYCONTENTS,user_id_str); 376 curl::curl_pair<CURLformoption,std::string> pass_cont(CURLFORM_COPYCONTENTS,user_id_str);
376 curl::curl_pair<CURLformoption,std::string> av_form(CURLFORM_COPYNAME,"avatar_url"); 377 curl::curl_pair<CURLformoption,std::string> av_form(CURLFORM_COPYNAME,"avatar_url");