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.DEFAULT_MIME_ENCODING, "");
Contact from =
IrcStack.this.provider.getPersistentPresence().findContactByID(
user);
IrcStack.this.provider.getPersistentPresence()
.findOrCreateContactByID(user);
IrcStack.this.provider.getBasicInstantMessaging()
.fireMessageReceived(message, from);
}

@ -44,23 +44,9 @@ protected OperationSetPersistentPresenceIrcImpl(
private ContactIrcImpl createVolatileContact(String id)
{
// Check whether a volatile group already exists and if not create
// one
// Get non-persistent group for volatile contacts.
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
ContactIrcImpl newVolatileContact =
new ContactIrcImpl(this.parentProvider, id, volatileGroup);
@ -87,7 +73,17 @@ private ContactGroupIrcImpl getNonPersistentGroup()
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()

Loading…
Cancel
Save