예제 #1
0
 private void cleanAllContacts() {
   List<ContactInfo> contactsNotALL = new ArrayList<ContactInfo>();
   for (Iterator<ContactInfo> iterator = contacts.iterator(); iterator.hasNext(); ) {
     ContactInfo type = iterator.next();
     if (!type.getChatType().equals(ChatType.ALL)) {
       contactsNotALL.add(type);
     }
   }
   contacts.removeAll(contactsNotALL);
 }
예제 #2
0
 public ContactCollection(List<ContactInfo> contacts) {
   super();
   for (ContactInfo contactInfo : contacts) {
     if (contactInfo.getStatus() == ContactStatus.pending) {
       pendingContacts.add(contactInfo);
     } else {
       this.contacts.add(contactInfo);
     }
   }
 }
예제 #3
0
  @Override
  public void internationalize(Messages messages) {
    ContactInfo owner = feed.getOwner();
    String gender = Gender.FEMALE == owner.getGender() ? "feed.import.female" : "feed.import.male";

    clear();

    StringBuilder sb = new StringBuilder();
    sb.append(messages.getMessage("feed.changed"));
    sb.append(messages.getMessage(gender));
    sb.append(messages.getMessage("feed.avatar"));
    this.getHeaderPanel().appendContactInfo(owner);
    this.getHeaderPanel().appendText(sb.toString());
    super.internationalize(messages);
  }
예제 #4
0
 @Test
 public void shouldUpdateContactProfile() throws Exception {
   @SuppressWarnings("deprecation")
   ContactInfo contactInfo = new ContactInfo();
   contactInfo.setEmail("*****@*****.**");
   contactInfo.setId(1L);
   Message<?> message =
       new AllMessage<ContactInfo>(
           MessEngineConstants.UPDATE_CONTACT_PROFILE_REQUEST, contactInfo);
   when(defaultTemplate.postForObject(
           anyString(), eq(JsonConverter.toJson(contactInfo)), eq(String.class)))
       .thenReturn(JsonConverter.toJson(contactInfo));
   messEngine.send(message);
   verify(defaultTemplate)
       .postForObject(anyString(), eq(JsonConverter.toJson(contactInfo)), eq(String.class));
   Message<?> response =
       messEngine.getMessage(MessEngineConstants.UPDATE_CONTACT_PROFILE_RESPONSE);
   assertNotNull(response);
   assertEquals(contactInfo, response.getBody());
 }
예제 #5
0
 @Override
 public void notifyContactUpdated(ContactInfo contact) {
   getFriendInfoPanel().notifyPresence(contact.getChatStatus());
 }