diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java index 266def0bf..9cf30d7f5 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetPersistentPresenceIcqImpl.java @@ -1070,11 +1070,47 @@ else if (evt.getEventID() == SubscriptionEvent.SUBSCRIPTION_REMOVED) listener.subscriptionRemoved(evt); else if (evt.getEventID() == SubscriptionEvent.SUBSCRIPTION_FAILED) listener.subscriptionFailed(evt); + } + } + } + + /** + * Notify all subscription listeners of the corresponding contact property + * change event. + * + * @param eventID the String ID of the event to dispatch + * @param sourceContact the ContactIcqImpl instance that this event is + * pertaining to. + * @param oldValue the value that the changed property had before the change + * occurred. + * @param newValue the value that the changed property currently has (after + * the change has occurred). + */ + void fireContactPropertyChangeEvent( String eventID, + ContactIcqImpl sourceContact, + Object oldValue, + Object newValue) + { + ContactPropertyChangeEvent evt = + new ContactPropertyChangeEvent(sourceContact, eventID + , oldValue, newValue); + logger.debug("Dispatching a Contact Property Change Event to" + +subscriptionListeners.size() + " listeners. Evt="+evt); + + synchronized(subscriptionListeners){ + Iterator listeners = subscriptionListeners.iterator(); + + while (listeners.hasNext()) + { + SubscriptionListener listener = + (SubscriptionListener) listeners.next(); + listener.contactModified(evt); } } } + /** * Notify all subscription listeners of the corresponding event. * diff --git a/src/net/java/sip/communicator/service/protocol/event/ContactPropertyChangeEvent.java b/src/net/java/sip/communicator/service/protocol/event/ContactPropertyChangeEvent.java index 12271b18e..3a608b7b6 100644 --- a/src/net/java/sip/communicator/service/protocol/event/ContactPropertyChangeEvent.java +++ b/src/net/java/sip/communicator/service/protocol/event/ContactPropertyChangeEvent.java @@ -29,10 +29,10 @@ public class ContactPropertyChangeEvent * @param oldValue the value of the property before the change occurred. * @param newValue the value of the property after the change occurred. */ - public ContactPropertyChangeEvent( Contact source, - String propertyName, - Object oldValue, - Object newValue) + public ContactPropertyChangeEvent( Contact source, + String propertyName, + Object oldValue, + Object newValue) { super(source, propertyName, oldValue, newValue); } @@ -46,4 +46,26 @@ public Contact getSourceContact() { return (Contact)getSource(); } + + /** + * Returns a reference to the protocol provider where the event has + * originated. + *

+ * @return a reference to the ProtocolProviderService instance where this + * event originated. + */ + public ProtocolProviderService getProtocolProvider() + { + return getSourceContact().getProtocolProvider(); + } + + /** + * Returns a reference to the source contact parent ContactGroup. + * @return a reference to the ContactGroup instance that contains + * the source Contact. + */ + public ContactGroup getParentContactGroup() + { + return getSourceContact().getParentContactGroup(); + } }