diff --git a/src/servers/registrar/RosterAppInfo.cpp b/src/servers/registrar/RosterAppInfo.cpp index 69c8f3aa53..bc10601d77 100644 --- a/src/servers/registrar/RosterAppInfo.cpp +++ b/src/servers/registrar/RosterAppInfo.cpp @@ -24,12 +24,33 @@ // Description: An extended app_info. //------------------------------------------------------------------------------ +#include + #include "RosterAppInfo.h" // constructor RosterAppInfo::RosterAppInfo() : app_info(), - state(APP_STATE_INVALID) + state(APP_STATE_INVALID), + token(0), + registration_time(0) { } +// Init +void +RosterAppInfo::Init(thread_id thread, team_id team, port_id port, uint32 flags, + const entry_ref *ref, const char *signature) +{ + this->thread = thread; + this->team = team; + this->port = port; + this->flags = flags; + this->ref = *ref; + if (signature) { + strncpy(this->signature, signature, B_MIME_TYPE_LENGTH - 1); + this->signature[B_MIME_TYPE_LENGTH - 1] = '\0'; + } else + this->signature[0] = '\0'; +} + diff --git a/src/servers/registrar/RosterAppInfo.h b/src/servers/registrar/RosterAppInfo.h index 8f81e31af2..5c78f66511 100644 --- a/src/servers/registrar/RosterAppInfo.h +++ b/src/servers/registrar/RosterAppInfo.h @@ -35,10 +35,17 @@ enum application_state { APP_STATE_REGISTERED, }; + struct RosterAppInfo : app_info { application_state state; + uint32 token; + // token is meaningful only if state is APP_STATE_PRE_REGISTERED and + // team is -1. + bigtime_t registration_time; // time of first addition RosterAppInfo(); + void Init(thread_id thread, team_id team, port_id port, uint32 flags, + const entry_ref *ref, const char *signature); }; #endif // ROSTER_APP_INFO_H