Which object should have the method?

I am trying to create an object model for a user and a chatroom. I’m stuck on where to place certain functionality when the objects collaborate.

At the moment all the functionality for the User is inside the User class, a snippet of its methods are:

  • User.JoinChatRoom()
  • User.WriteChatRoomMessage()
  • User.Authenticate()
  • User.JoinGroup()

I recognize that is this is a “God Object”/”Blob”” and instead we could model this as seperate objects ChatRoom, User and Group with the methods:

  • User.Authenticate()
  • ChatRoom.AddPlayer(User u)
  • ChatRoom.WriteMessage(String msg)
  • Group.AddPlayer(User u)

But I am confused about this refactor since, the way I understand object methods is that they perform an operation on the object. Therefore you can command the user to write to a chatroom, command the user to join a group, etc.

But with the “cleaner” second model this doesn’t seem to fit, there is no explicit JoinChatRoom() method.

How do I design and think about what methods should be attached to an object?