that (`chatDB->addUserToChat(other.ID, chat);`) can't work. First, it already happens in InterServerI::invite, second, what if the chat is on a remote server? 
Simply remove the line from here.