diff --git a/src/common/connection.py b/src/common/connection.py
index 4f8fdf97759101745660c2d063fa22b5964a39e4..b49149a08fcdfbdc660c9784e303c3cc5008c58d 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1199,7 +1199,7 @@ class Connection(ConnectionHandlers):
 		msgenc = ''
 
 		if session:
-			fjid = str(session.jid)
+			fjid = session.get_to()
 
 		if keyID and self.USE_GPG:
 			xhtml = None
diff --git a/src/common/stanza_session.py b/src/common/stanza_session.py
index d5a5ec9e792471d2e338fac15da5d3f226e37651..51a12b4885c9bdc29d7212821c4d9a7d0199e831 100644
--- a/src/common/stanza_session.py
+++ b/src/common/stanza_session.py
@@ -54,6 +54,7 @@ class StanzaSession(object):
 		self.conn = conn
 		self.jid = jid
 		self.type = type_
+		self.resource = None
 
 		if thread_id:
 			self.received_thread_id = True
@@ -75,6 +76,12 @@ class StanzaSession(object):
 	def is_loggable(self):
 		return self.loggable and gajim.config.should_log(self.conn.name, self.jid)
 
+	def get_to(self):
+		to = str(self.jid)
+		if self.resource:
+			to += '/' + self.resource
+		return to
+
 	def remove_events(self, types):
 		'''
 		Remove events associated with this session from the queue.
@@ -107,7 +114,7 @@ class StanzaSession(object):
 		if self.thread_id:
 			msg.NT.thread = self.thread_id
 
-		msg.setAttr('to', self.jid)
+		msg.setAttr('to', self.get_to())
 		self.conn.send_stanza(msg)
 
 		if isinstance(msg, xmpp.Message):
diff --git a/src/session.py b/src/session.py
index 6f5e0627cbfd87bffb393560daefc6760622be98..f68d7c2dccbdfbbb1b2fa6adc637c4e4030b86d4 100644
--- a/src/session.py
+++ b/src/session.py
@@ -86,6 +86,10 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
 		'''dispatch a received <message> stanza'''
 		msg_type = msg.getType()
 		subject = msg.getSubject()
+		if self.jid != full_jid_with_resource:
+			self.resource = gajim.get_nick_from_fjid(full_jid_with_resource)
+			if self.control:
+				self.control.resource = self.resource
 
 		if not msg_type or msg_type not in ('chat', 'groupchat', 'error'):
 			msg_type = 'normal'