API: Bugfix: Wrong contact ids with direct messages

There was a bug in the direct messages that the wrong contact id was sent.