I don't think it is possible to know who invited you, but I might be wrong.
Perhaps one exception I am aware of is moving messages. That gives an automatic invitation - and you can see in the transcript which user moved messages.
For example, if someones will consider the above messages off topic for this room and moves them elsewhere, we'll both get invitations.
@MartinSleziak Oh no, I was invited to the h bar and I pinged you because I feel comfortable with you and find you as a right person to ask questions related to functioning of the sites.