8d50a6b9a4
Now, instead of using Utils.cpp's AccountCachePath and AddOnCachePath, and add-on should implement ChatProtocol::SetAccountCachePath and ChatProtocol::SetAddOnCachePath. In addition, most path-related functions in Utils now return BPaths― and some of interest to chat add-ons can accept the path given by ChatProtocol::SetAccountCachePath as the main argument.
40 lines
743 B
C++
40 lines
743 B
C++
/*
|
|
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
|
* Copyright 2012, Dario Casalinuovo. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Andrea Anzani, andrea.anzani@gmail.com
|
|
* Dario Casalinuovo
|
|
*/
|
|
#include "Contact.h"
|
|
|
|
#include "Utils.h"
|
|
#include "ProtocolLooper.h"
|
|
#include "RosterItem.h"
|
|
|
|
|
|
Contact::Contact(BString id, BMessenger msgn)
|
|
:
|
|
User::User(id, msgn)
|
|
{
|
|
fRosterItem = new RosterItem(id.String(), this);
|
|
RegisterObserver(fRosterItem);
|
|
}
|
|
|
|
|
|
RosterItem*
|
|
Contact::GetRosterItem() const
|
|
{
|
|
return fRosterItem;
|
|
}
|
|
|
|
|
|
void
|
|
Contact::_EnsureCachePath()
|
|
{
|
|
if (fCachePath.InitCheck() == B_OK)
|
|
return;
|
|
fCachePath = ContactCachePath(fLooper->Protocol()->GetName(), fID.String());
|
|
}
|