(contact)
| 45 | } |
| 46 | |
| 47 | export function getDisplayName (contact) { |
| 48 | if (isRoomContact(contact)) { |
| 49 | if (contact.MemberCount >= 2) { |
| 50 | return '[群] ' + (contact.RemarkName || contact.DisplayName || contact.NickName || |
| 51 | `${getDisplayName(contact.MemberList[0])}、${getDisplayName(contact.MemberList[1])}`) |
| 52 | } else { |
| 53 | return '[群] ' + (contact.RemarkName || contact.DisplayName || contact.NickName || |
| 54 | `${getDisplayName(contact.MemberList[0])}`) |
| 55 | } |
| 56 | } else { |
| 57 | return contact.DisplayName || contact.RemarkName || contact.NickName || contact.UserName |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | export function isRoomContact (contact) { |
| 62 | return contact.UserName ? /^@@|@chatroom$/.test(contact.UserName) : false |
no test coverage detected