test_class.declarator: client
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private Client client;
test_class.type: Client
test_class.var_name: client
test_class.declarator: chatMessageManager
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private ChatMessageManager chatMessageManager;
test_class.type: ChatMessageManager
test_class.var_name: chatMessageManager
test_class.declarator: emojiPlugin
test_class.modifier: @Inject
  	private
test_class.original_string: @Inject
  	private EmojiPlugin emojiPlugin;
test_class.type: EmojiPlugin
test_class.var_name: emojiPlugin
test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/emojis/EmojiPluginTest.java
test_class.identifier: EmojiPluginTest
test_case.body: @Test
  	public void testOnChatMessage()
  	{
  		when(client.getGameState()).thenReturn(GameState.LOGGED_IN);
  		when(client.getModIcons()).thenReturn(new IndexedSprite[0]);
  		when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class));
  
  		// Trip emoji loading
  		GameStateChanged gameStateChanged = new GameStateChanged();
  		gameStateChanged.setGameState(GameState.LOGGED_IN);
  		emojiPlugin.onGameStateChanged(gameStateChanged);
  
  		MessageNode messageNode = mock(MessageNode.class);
  		// With chat recolor, message may be wrapped in col tags
  		when(messageNode.getValue()).thenReturn("<col=ff0000>:) :) :)</col>");
  
  		ChatMessage chatMessage = new ChatMessage();
  		chatMessage.setType(ChatMessageType.PUBLICCHAT);
  		chatMessage.setMessageNode(messageNode);
  
  		emojiPlugin.onChatMessage(chatMessage);
  
  		verify(messageNode).setRuneLiteFormatMessage("<col=ff0000><img=0> <img=0> <img=0></col>");
  	}
test_case.class_method_signature: EmojiPluginTest.testOnChatMessage()
test_case.full_signature: @Test public void testOnChatMessage()
test_case.identifier: testOnChatMessage
test_case.invocations: thenReturn when getGameState thenReturn when getModIcons thenReturn when createIndexedSprite mock setGameState onGameStateChanged mock thenReturn when getValue setType setMessageNode onChatMessage setRuneLiteFormatMessage verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOnChatMessage()
focal_class.declarator: WHITESPACE_REGEXP = Pattern.compile("[\\s\\u00A0]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern WHITESPACE_REGEXP = Pattern.compile("[\\s\\u00A0]");
focal_class.type: Pattern
focal_class.var_name: WHITESPACE_REGEXP
focal_class.declarator: client
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private Client client;
focal_class.type: Client
focal_class.var_name: client
focal_class.declarator: clientThread
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ClientThread clientThread;
focal_class.type: ClientThread
focal_class.var_name: clientThread
focal_class.declarator: chatMessageManager
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ChatMessageManager chatMessageManager;
focal_class.type: ChatMessageManager
focal_class.var_name: chatMessageManager
focal_class.declarator: modIconsStart = -1
focal_class.modifier: private
focal_class.original_string: private int modIconsStart = -1;
focal_class.type: int
focal_class.var_name: modIconsStart
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java
focal_class.identifier: EmojiPlugin
focal_class.class_method_signature: EmojiPlugin.startUp()
focal_class.full_signature: @Override protected void startUp()
focal_class.identifier: startUp
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startUp()
focal_class.class_method_signature: EmojiPlugin.onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.full_signature: @Subscribe public void onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.identifier: onGameStateChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (GameStateChanged gameStateChanged)
focal_class.return: void
focal_class.signature: void onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.class_method_signature: EmojiPlugin.loadEmojiIcons()
focal_class.full_signature: private void loadEmojiIcons()
focal_class.identifier: loadEmojiIcons
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadEmojiIcons()
focal_class.class_method_signature: EmojiPlugin.onChatMessage(ChatMessage chatMessage)
focal_class.full_signature: @Subscribe public void onChatMessage(ChatMessage chatMessage)
focal_class.identifier: onChatMessage
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ChatMessage chatMessage)
focal_class.return: void
focal_class.signature: void onChatMessage(ChatMessage chatMessage)
focal_class.class_method_signature: EmojiPlugin.onOverheadTextChanged(final OverheadTextChanged event)
focal_class.full_signature: @Subscribe public void onOverheadTextChanged(final OverheadTextChanged event)
focal_class.identifier: onOverheadTextChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (final OverheadTextChanged event)
focal_class.return: void
focal_class.signature: void onOverheadTextChanged(final OverheadTextChanged event)
focal_class.class_method_signature: EmojiPlugin.updateMessage(final String message)
focal_class.full_signature: @Nullable String updateMessage(final String message)
focal_class.identifier: updateMessage
focal_class.modifiers: @Nullable
focal_class.parameters: (final String message)
focal_class.return: String
focal_class.signature: String updateMessage(final String message)
focal_class.superclass: extends Plugin
focal_method.body: @Subscribe
  	public void onChatMessage(ChatMessage chatMessage)
  	{
  		if (client.getGameState() != GameState.LOGGED_IN || modIconsStart == -1)
  		{
  			return;
  		}
  
  		switch (chatMessage.getType())
  		{
  			case PUBLICCHAT:
  			case MODCHAT:
  			case FRIENDSCHAT:
  			case PRIVATECHAT:
  			case PRIVATECHATOUT:
  			case MODPRIVATECHAT:
  				break;
  			default:
  				return;
  		}
  
  		final MessageNode messageNode = chatMessage.getMessageNode();
  		final String message = messageNode.getValue();
  		final String updatedMessage = updateMessage(message);
  
  		if (updatedMessage == null)
  		{
  			return;
  		}
  
  		messageNode.setRuneLiteFormatMessage(updatedMessage);
  		chatMessageManager.update(messageNode);
  		client.refreshChat();
  	}
focal_method.class_method_signature: EmojiPlugin.onChatMessage(ChatMessage chatMessage)
focal_method.full_signature: @Subscribe public void onChatMessage(ChatMessage chatMessage)
focal_method.identifier: onChatMessage
focal_method.invocations: getGameState getType getMessageNode getValue updateMessage setRuneLiteFormatMessage update refreshChat
focal_method.modifiers: @Subscribe public
focal_method.parameters: (ChatMessage chatMessage)
focal_method.return: void
focal_method.signature: void onChatMessage(ChatMessage chatMessage)