Currently, when the user opens a ConversationActivity, goes off to do
something else without closing it, and then comes back to the activity,
conversations started since the ConversationActivity was paused (e.g. by
an incoming private message) will not appear in the ConversationGallery;
this is because we never check for new conversations in the onResume()
path.

Fortunately, this is an easy fix: we're already looping over all the
conversations in onResume() in order to add new messages to the
MessageListViews, so just look out for the new conversations and add
them to the ConversationGallery when we see them.
---
 .../org/yaaic/activity/ConversationActivity.java   |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/application/src/org/yaaic/activity/ConversationActivity.java 
b/application/src/org/yaaic/activity/ConversationActivity.java
index b72f456..86e07eb 100644
--- a/application/src/org/yaaic/activity/ConversationActivity.java
+++ b/application/src/org/yaaic/activity/ConversationActivity.java
@@ -312,11 +312,17 @@ public class ConversationActivity extends Activity 
implements ServiceConnection,
 
         // Fill view with messages that have been buffered while paused
         for (Conversation conversation : mConversations) {
-            mAdapter = deckAdapter.getItemAdapter(conversation.getName());
+            String name = conversation.getName();
+            mAdapter = deckAdapter.getItemAdapter(name);
 
             if (mAdapter != null) {
                 mAdapter.addBulkMessages(conversation.getBuffer());
                 conversation.clearBuffer();
+            } else {
+                // Was conversation created while we were paused?
+                if (deckAdapter.getPositionByName(name) == -1) {
+                    onNewConversation(name);
+                }
             }
 
             // Clear new message notifications for the selected conversation
@@ -324,7 +330,7 @@ public class ConversationActivity extends Activity 
implements ServiceConnection,
                 Intent ackIntent = new Intent(this, IRCService.class);
                 ackIntent.setAction(IRCService.ACTION_ACK_NEW_MENTIONS);
                 ackIntent.putExtra(IRCService.EXTRA_ACK_SERVERID, serverId);
-                ackIntent.putExtra(IRCService.EXTRA_ACK_CONVTITLE, 
conversation.getName());
+                ackIntent.putExtra(IRCService.EXTRA_ACK_CONVTITLE, name);
                 startService(ackIntent);
             }
         }
-- 
1.7.2.5

Reply via email to