$ git clone http://tcclient.ion.nu/tc_client.git
commit 3c689323cd29ebf8fe05d9e08b027f440b1fe803
Author: Alicia <...>
Date:   Sun Oct 9 00:16:59 2016 +0200

    Fixed a bug that caused tc_client to not know the nickname if the chosen one wasn't available at startup, manifesting as broadcasting not working unless the initial nickname was free.

diff --git a/ChangeLog b/ChangeLog
index 32b2949..a4b2d2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 Moved the backward compatibility code for avcodec_{send,receive}_{frame,packet} into a separate source file to avoid pulling libavcodec into utilities that don't use it.
 Improved the RTMP acknowledgement code: counting the format 3 headers which were previously skipped, setting a more reasonable acknowledgement interval at startup and giving the server some margin before dropping outgoing video packets.
 Interpret the "from_owner" subcommand "_close" to tell if our media stream was closed.
+Fixed a bug that caused tc_client to not know the nickname if the chosen one wasn't available at startup, manifesting as broadcasting not working unless the initial nickname was free.
 tc_client-gtk: merged camera_remove() and camera_removebynick() into a single function, merged the deallocation of camera data into camera_free()
 tc_client-gtk: moved the postprocessing code into its own source file.
 tc_client-gtk: added greenscreen postprocessor.
diff --git a/client.c b/client.c
index 7ca62ae..2a7c8b5 100644
--- a/client.c
+++ b/client.c
@@ -881,15 +881,16 @@ int main(int argc, char** argv)
             amfstring(&amf, key);
             amfsend(&amf, sock);
             free(key);
-            if(nickname[0]) // Empty = don't set one
-            {
-              amfinit(&amf, 3);
-              amfstring(&amf, "nick");
-              amfnum(&amf, 0);
-              amfnull(&amf);
-              amfstring(&amf, nickname);
-              amfsend(&amf, sock);
-            }
+            // Set the given nickname
+            amfinit(&amf, 3);
+            amfstring(&amf, "nick");
+            amfnum(&amf, 0);
+            amfnull(&amf);
+            amfstring(&amf, nickname);
+            amfsend(&amf, sock);
+            // Keep what the server gave us, just in case
+            free(nickname);
+            nickname=strdup(nick);
           }
         }
       }