Create new volatile contact for incoming private message if necessary.

fix-message-formatting
Danny van Heumen 11 years ago
parent 9b8fb46f9f
commit 23763112c7

@ -1034,8 +1034,8 @@ public void onUserNotice(UserNotice msg)
OperationSetBasicInstantMessaging.HTML_MIME_TYPE, OperationSetBasicInstantMessaging.HTML_MIME_TYPE,
OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING, ""); OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING, "");
Contact from = Contact from =
IrcStack.this.provider.getPersistentPresence().findContactByID( IrcStack.this.provider.getPersistentPresence()
user); .findOrCreateContactByID(user);
IrcStack.this.provider.getBasicInstantMessaging() IrcStack.this.provider.getBasicInstantMessaging()
.fireMessageReceived(message, from); .fireMessageReceived(message, from);
} }

@ -44,23 +44,9 @@ protected OperationSetPersistentPresenceIrcImpl(
private ContactIrcImpl createVolatileContact(String id) private ContactIrcImpl createVolatileContact(String id)
{ {
// Check whether a volatile group already exists and if not create // Get non-persistent group for volatile contacts.
// one
ContactGroupIrcImpl volatileGroup = getNonPersistentGroup(); ContactGroupIrcImpl volatileGroup = getNonPersistentGroup();
if (volatileGroup == null)
{
volatileGroup =
new ContactGroupIrcImpl(this.parentProvider, this.rootGroup,
IrcActivator.getResources().getI18NString(
"service.gui.NOT_IN_CONTACT_LIST_GROUP_NAME"));
this.rootGroup.addSubGroup(volatileGroup);
this.fireServerStoredGroupEvent(volatileGroup,
ServerStoredGroupEvent.GROUP_CREATED_EVENT);
}
// Create volatile contact // Create volatile contact
ContactIrcImpl newVolatileContact = ContactIrcImpl newVolatileContact =
new ContactIrcImpl(this.parentProvider, id, volatileGroup); new ContactIrcImpl(this.parentProvider, id, volatileGroup);
@ -87,7 +73,17 @@ private ContactGroupIrcImpl getNonPersistentGroup()
return gr; return gr;
} }
return null; ContactGroupIrcImpl volatileGroup =
new ContactGroupIrcImpl(this.parentProvider, this.rootGroup,
IrcActivator.getResources().getI18NString(
"service.gui.NOT_IN_CONTACT_LIST_GROUP_NAME"));
this.rootGroup.addSubGroup(volatileGroup);
this.fireServerStoredGroupEvent(volatileGroup,
ServerStoredGroupEvent.GROUP_CREATED_EVENT);
return volatileGroup;
} }
public ContactGroup getRootGroup() public ContactGroup getRootGroup()

Loading…
Cancel
Save