Contact.cpp 762 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright 2009-2011, Andrea Anzani. All rights reserved.
  3. * Copyright 2012, Dario Casalinuovo. All rights reserved.
  4. * Distributed under the terms of the MIT License.
  5. *
  6. * Authors:
  7. * Andrea Anzani, andrea.anzani@gmail.com
  8. * Dario Casalinuovo
  9. */
  10. #include "Contact.h"
  11. #include "Utils.h"
  12. #include "ProtocolLooper.h"
  13. #include "RosterItem.h"
  14. Contact::Contact(BString id, BMessenger msgn)
  15. :
  16. User::User(id, msgn)
  17. {
  18. fRosterItem = new RosterItem(id.String(), this);
  19. RegisterObserver(fRosterItem);
  20. }
  21. RosterItem*
  22. Contact::GetRosterItem() const
  23. {
  24. return fRosterItem;
  25. }
  26. void
  27. Contact::_EnsureCachePath()
  28. {
  29. if (fCachePath.InitCheck() == B_OK)
  30. return;
  31. fCachePath.SetTo(ContactCachePath(fLooper->Protocol()->GetName(),
  32. fID.String()));
  33. }