From d744dd13ab9978cbd7d272c1004f4e12b87511c8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 28 Jul 2002 13:42:03 +0000 Subject: [PATCH] * Changed the return value in HandleCompleteRegistration() in case of not found or already completely registered applications from B_REG_APP_NOT_REGISTERED to B_REG_APP_NOT_PRE_REGISTERED. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@497 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/TRoster.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index f60c9e92b9..68706e9781 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -233,12 +233,13 @@ TRoster::HandleCompleteRegistration(BMessage *request) if (error == B_OK) { if (team >= 0) { // everything is fine -- set the values - if (RosterAppInfo *info = fRegisteredApps.InfoFor(team)) { + RosterAppInfo *info = fRegisteredApps.InfoFor(team); + if (info && info->state == APP_STATE_PRE_REGISTERED) { info->thread = thread; info->port = port; info->state = APP_STATE_REGISTERED; } else - SET_ERROR(error, B_REG_APP_NOT_REGISTERED); + SET_ERROR(error, B_REG_APP_NOT_PRE_REGISTERED); } else SET_ERROR(error, B_BAD_VALUE); } @@ -534,9 +535,9 @@ TRoster::HandleGetAppList(BMessage *request) if (error == B_OK) { BMessage reply(B_REG_SUCCESS); // get the list - for (int32 i = 0; - RosterAppInfo *info = fRegisteredApps.InfoAt(i); - i++) { + for (AppInfoList::Iterator it(fRegisteredApps.It()); + RosterAppInfo *info = *it; + ++it) { if (!signature || !strcmp(signature, info->signature)) reply.AddInt32("teams", info->team); } @@ -766,7 +767,7 @@ TRoster::_ReplyToIAPRRequest(BMessage *request, const RosterAppInfo *info) case APP_STATE_PRE_REGISTERED: preRegistered = true; break; - case APP_STATE_INVALID: + case APP_STATE_UNREGISTERED: case APP_STATE_REGISTERED: preRegistered = false; break;