2010-05-07 04:47:10 -05:00
|
|
|
/*
|
2011-12-03 16:38:03 -06:00
|
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
2012-05-01 16:09:56 -05:00
|
|
|
* Copyright 2012, Dario Casalinuovo. All rights reserved.
|
2010-05-07 04:47:10 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Andrea Anzani, andrea.anzani@gmail.com
|
2012-05-01 16:09:56 -05:00
|
|
|
* Dario Casalinuovo
|
2010-05-07 04:47:10 -05:00
|
|
|
*/
|
2021-05-23 14:39:07 -05:00
|
|
|
#include "Contact.h"
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2021-06-20 12:44:20 -05:00
|
|
|
#include "Utils.h"
|
2021-06-13 17:34:30 -05:00
|
|
|
#include "ProtocolLooper.h"
|
2010-05-07 04:47:10 -05:00
|
|
|
#include "RosterItem.h"
|
|
|
|
|
2010-05-28 12:20:02 -05:00
|
|
|
|
2021-05-23 14:39:07 -05:00
|
|
|
Contact::Contact(BString id, BMessenger msgn)
|
2010-05-19 17:28:26 -05:00
|
|
|
:
|
2021-05-24 01:47:21 -05:00
|
|
|
User::User(id, msgn)
|
2010-05-07 04:47:10 -05:00
|
|
|
{
|
|
|
|
fRosterItem = new RosterItem(id.String(), this);
|
|
|
|
RegisterObserver(fRosterItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-03-07 13:22:09 -06:00
|
|
|
RosterItem*
|
2021-05-23 14:39:07 -05:00
|
|
|
Contact::GetRosterItem() const
|
2012-03-07 13:22:09 -06:00
|
|
|
{
|
|
|
|
return fRosterItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-13 17:34:30 -05:00
|
|
|
void
|
|
|
|
Contact::_EnsureCachePath()
|
|
|
|
{
|
|
|
|
if (fCachePath.InitCheck() == B_OK)
|
|
|
|
return;
|
2021-06-20 12:44:20 -05:00
|
|
|
fCachePath.SetTo(ContactCachePath(fLooper->Protocol()->GetName(),
|
2021-06-13 17:34:30 -05:00
|
|
|
fID.String()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|