From 1fe811468562aaf9cf1583997fb0894c0f56da15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Wed, 20 Apr 2011 22:36:28 +0200
Subject: Return groups vector by reference.

This avoids a potential crash.

Resolves: #842
Release-Notes: Fixed a crash in roster handling

diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp
index c6064d6..0fe88aa 100644
--- a/Swift/Controllers/Roster/ContactRosterItem.cpp
+++ b/Swift/Controllers/Roster/ContactRosterItem.cpp
@@ -99,7 +99,7 @@ void ContactRosterItem::applyPresence(const std::string& resource, boost::shared
 	onDataChanged();
 }
 
-const std::vector<std::string> ContactRosterItem::getGroups() const {
+const std::vector<std::string>& ContactRosterItem::getGroups() const {
 	return groups_;
 }
 
diff --git a/Swift/Controllers/Roster/ContactRosterItem.h b/Swift/Controllers/Roster/ContactRosterItem.h
index ae8d5b0..7aa948c 100644
--- a/Swift/Controllers/Roster/ContactRosterItem.h
+++ b/Swift/Controllers/Roster/ContactRosterItem.h
@@ -36,7 +36,7 @@ class ContactRosterItem : public RosterItem {
 		void applyPresence(const std::string& resource, boost::shared_ptr<Presence> presence);
 		void clearPresence();
 		void calculateShownPresence();
-		const std::vector<std::string> getGroups() const;
+		const std::vector<std::string>& getGroups() const;
 		/** Only used so a contact can know about the groups it's in*/
 		void addGroup(const std::string& group);
 		void removeGroup(const std::string& group);
-- 
cgit v0.10.2-6-g49f6