Show BuddyPress Avatars in Chatroom

Hi support,

I have a third-party chatroom script that I use on my BuddyPress site. What I would like to achieve is to replace the default chatroom Avatars with members actual BuddyPress Avatars instead…

I believe the line of code I need to modify to accomplish this is lies within a Javascript file. Essentially, how can I modify the line of code below to fix this?

var newMessage = “<img style=’vertical-align:middle; height:24px; padding-left:5px;’ src=’”+mUID+”‘> &#8220;;

I’ve been told that I need to use bp_core_fetch_avatar() somewhere, but am clueless as how to achieve this.

Any help greatly appreciated.