This is not safe to do, the ID of a chat alone is not unique, ProtocolManager and ChatType are missing. You should probably store the ChatView object and compare with that (if it doesn't support Equals() yet that should be changed).