talk icon indicating copy to clipboard operation
talk copied to clipboard

Custom user id column issue

Open jampack opened this issue 9 years ago • 1 comments

In my User table the user id column is 'user_id' apart from default 'id' which is causing issue with Talk::threads() method as it is showing withUser->user_id and rest of the fields same to both the parties which is user one or the one who initiates the conversation. the issue is fixed by changing the id field to user_id in

Nahid\Talk\Conversations\ConversationRepository

threads() method

$conversationWith = ($thread->userone->id == $user) ? $thread->usertwo : $thread->userone;

to

$conversationWith = ($thread->userone->user_id == $user) ? $thread->usertwo : $thread->userone;

May be you should define a variable for that in the talk.config for people having custom field names.

jampack avatar Mar 22 '17 11:03 jampack

this applies to other methods too, like the same issue with getMessagesByUserID(), where withUser was returned with same user details who initiated the conversation.

jampack avatar Mar 23 '17 07:03 jampack