Changes ui service to be able to start sms chats from plugins.

fix-message-formatting 5136
Damian Minkov 13 years ago
parent 8a8b05170c
commit d5e1bc6cb2

@ -174,6 +174,9 @@ service.gui.buttons.ADD_CONTACT_BUTTON_SMALL_ROLLOVER=resources/images/impl/gui/
service.gui.buttons.WEB_BUTTON=resources/images/impl/gui/buttons/webButton.png
service.gui.buttons.WEB_BUTTON_PRESSED=resources/images/impl/gui/buttons/webButtonPressed.png
service.gui.buttons.WEB_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/webButtonSelected.png
service.gui.buttons.SMS_BUTTON=resources/images/impl/gui/buttons/smsButton.png
service.gui.buttons.SMS_BUTTON_PRESSED=resources/images/impl/gui/buttons/smsButtonPressed.png
service.gui.buttons.SMS_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/smsButtonSelected.png
service.gui.buttons.HANGUP_BUTTON_BG=resources/images/impl/gui/buttons/hangupButton.png
service.gui.buttons.HANGUP_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/hangupButtonRollover.png
service.gui.buttons.HANGUP_BUTTON_PRESSED=resources/images/impl/gui/buttons/hangupButtonPressed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -1538,9 +1538,21 @@ public void createCall(String[] participants)
* @see UIService#startChat(String[])
*/
public void startChat(String[] participants)
{
startChat(participants, false);
}
/**
* Starts a new <tt>Chat</tt> with a specific set of participants.
*
* @param participants an array of <tt>String</tt> values specifying the
* participants to be included into the newly created <tt>Chat</tt>
* @param isSmsEnabled whether sms option should be enabled if possible
*/
public void startChat(String[] participants, boolean isSmsEnabled)
{
if (participants.length == 1)
getChatWindowManager().startChat(participants[0]);
getChatWindowManager().startChat(participants[0], isSmsEnabled);
else
throw new IllegalArgumentException("participants");
}

@ -921,6 +921,11 @@ public void startChat( MetaContact metaContact,
}
public void startChat(String contactString)
{
startChat(contactString, false);
}
public void startChat(String contactString, boolean isSmsEnabled)
{
List<ProtocolProviderService> imProviders
= AccountUtils.getRegisteredProviders(
@ -965,7 +970,34 @@ public void startChat(String contactString)
}
}
if (startChat)
startChat(metaContact, contact, false);
startChat(metaContact, contact, isSmsEnabled);
else if(isSmsEnabled)
{
// nothing found but we want to send sms, lets check and create
// the contact as it may not exist
List<ProtocolProviderService> smsProviders
= AccountUtils.getRegisteredProviders(
OperationSetSmsMessaging.class);
if(smsProviders == null || smsProviders.size() == 0)
return;
OperationSetSmsMessaging smsOpSet
= smsProviders.get(0)
.getOperationSet(OperationSetSmsMessaging.class);
contact = smsOpSet.getContact(contactString);
if (contact != null)
{
metaContact
= metaContactListService.findMetaContactByContact(contact);
if (metaContact != null)
{
startChat(metaContact, contact, isSmsEnabled);
}
}
}
}
/**

@ -453,6 +453,15 @@ public SecurityAuthority getDefaultSecurityAuthority(
*/
public void startChat(String[] participants);
/**
* Starts a new <tt>Chat</tt> with a specific set of participants.
*
* @param participants an array of <tt>String</tt> values specifying the
* participants to be included into the newly created <tt>Chat</tt>
* @param isSmsEnabled whether sms option should be enabled if possible
*/
public void startChat(String[] participants, boolean isSmsEnabled);
/**
* Creates a contact list component.
*

Loading…
Cancel
Save