The user id substitution is of the user it was able to find. You can access a triggers variables using [var#]. The variables for onAfterAddConnection are as follows.
1: $this->referenceid
2: $connectionid
3: $ueConfig
4: $ueConfig
So for example you'd use [var1] and [var2] to obtain the IDs of the user sending the connection request and the user receiving the connection request.
With that trigger variable 1 would be the first ID it found so the user making the request would be used for [user_id] and other user substitutions.
For further trigger variable information please see the below tutorial.
www.joomlapolis.com/support/tutorials/120-api-usage/18358-using-cb-triggers