The friend address is what the byte string that you give away for people
to add you will be called.
1. Every friend address now contains a number set by the friend. This is
to prevent someone from randomly spamming people in the DHT with friend
requests and makes it so you need the person to actually give you the
address in some way to send the friend request. This number is expected
to be encrypted with the friend request. All requests that do not
contain this number will be rejected. This means the spammer can no
longer use the DHT to collect lists of valid addresses to spam. It also
enables users to quickly change the number in case a spammer gets hold
of the address and starts spamming it.
2. A 2 byte checksum will be added (not implemented yet) to prevent
people from accidentally adding random strings as friends. (NOTE that
this has nothing to do with the spam problem I just decided to add a
placeholder for it now.)
Moves static state out of Messenger.c and into a Messenger struct
Purely stylistic, no functional changes were made.
This commit also changed all the callers of Messenger as they now have
to pass an instance of the Messenger struct to messenger functions.
Also removed some uses of the 'static' keyword at the beginning of
function definitions when the function was already declared static, as
these caused gcc to whine.
Add several frees that were missing to prevent memory leaks
Replace strcpy with strdup where appropriate
Replace _stat with __stat64 for building on Windows
Users can just respecify their status with a message. This will also encourage users to think about which status is actually appropriate instead of just leaving the status alone.