Skip to content

Commit ca004ea

Browse files
authored
Merge pull request #264 from jolavillette/fix-chat-lobby-persistence
Fix chat lobby persistence and identity save issues
2 parents 75913ac + 5daafd7 commit ca004ea

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/chat/distributedchat.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,6 @@ bool DistributedChatService::acceptLobbyInvite(const ChatLobbyId& lobby_id,const
15041504
entry.last_connexion_challenge_time = now ;
15051505
entry.joined_lobby_packet_sent = false;
15061506
entry.last_keep_alive_packet_time = now ;
1507-
15081507
_chat_lobbys[lobby_id] = entry ;
15091508

15101509
_lobby_invites_queue.erase(it) ; // remove the invite from cache.
@@ -1517,14 +1516,18 @@ bool DistributedChatService::acceptLobbyInvite(const ChatLobbyId& lobby_id,const
15171516
RsChatLobbyMsgItem *item = new RsChatLobbyMsgItem;
15181517
item->lobby_id = entry.lobby_id ;
15191518
item->msg_id = 0 ;
1520-
item->parent_msg_id = 0 ;
1521-
item->nick = "Chat room management" ;
1519+
item->parent_msg_id = 0 ;
1520+
item->nick = "Chat room management" ;
15221521
item->message = std::string("Welcome to chat lobby") ;
15231522
item->PeerId(entry.virtual_peer_id) ;
15241523
item->chatFlags = RS_CHAT_FLAG_PRIVATE | RS_CHAT_FLAG_LOBBY ;
15251524

15261525
locked_storeIncomingMsg(item) ;
15271526
}
1527+
1528+
setLobbyAutoSubscribe(lobby_id, true);
1529+
triggerConfigSave(); // so that we save the subscribed lobbies
1530+
15281531
#ifdef DEBUG_CHAT_LOBBIES
15291532
std::cerr << " Notifying of new recvd msg." << std::endl ;
15301533
#endif
@@ -1706,6 +1709,7 @@ ChatLobbyId DistributedChatService::createChatLobby(const std::string& lobby_nam
17061709
ev->mEventCode = RsChatLobbyEventCode::CHAT_LOBBY_LIST_CHANGED;
17071710
rsEvents->postEvent(ev);
17081711

1712+
setLobbyAutoSubscribe(lobby_id, true);
17091713
triggerConfigSave();
17101714

17111715
return lobby_id ;
@@ -1910,6 +1914,8 @@ bool DistributedChatService::setIdentityForChatLobby(const ChatLobbyId& lobby_id
19101914
it->second.gxs_id = nick ;
19111915
}
19121916

1917+
triggerConfigSave() ;
1918+
19131919
return true ;
19141920
}
19151921

0 commit comments

Comments
 (0)