mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 05:22:31 -04:00
added consistent detection of time-shift in chat lobbies. Shows a warning when the shift is larger than 2^9 seconds (approx. 10 minutes. Warning shown only once).
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6242 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a850b18be2
commit
7f53f0e0cc
6 changed files with 95 additions and 0 deletions
|
@ -446,6 +446,32 @@ void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string&
|
|||
emit peerHasNewCustomStateString(QString::fromStdString(peer_id), QString::fromUtf8(status_string.c_str())) ;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyChatLobbyTimeShift(int shift)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "notifyQt: Received chat lobby time shift message: shift = " << shift << std::endl;
|
||||
#endif
|
||||
emit chatLobbyTimeShift(shift) ;
|
||||
}
|
||||
void NotifyQt::handleChatLobbyTimeShift(int shift)
|
||||
{
|
||||
static bool already = false ;
|
||||
|
||||
if(!already)
|
||||
{
|
||||
QString string = tr("For the chat lobbies to work properly, the time of your computer needs to be correct. Please check that this is the case (A possible time shift of ")+QString::number(shift)+tr(" seconds with your friends was detected). ") ;
|
||||
|
||||
QMessageBox::warning(NULL,tr("Please check your system clock."),string) ;
|
||||
already = true ;
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyQt::notifyChatLobbyEvent(uint64_t lobby_id,uint32_t event_type,const std::string& nickname,const std::string& str)
|
||||
{
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue