How to use the deltachat-node/constants.DC_CHAT_ID_DEADDROP function in deltachat-node

To help you get started, we’ve selected a few deltachat-node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deltachat / deltachat-desktop / src / main / deltachat.js View on Github external
_chatList (showArchivedChats) {
    if (!this._dc) return []

    const listFlags = showArchivedChats ? C.DC_GCL_ARCHIVED_ONLY : 0
    const list = this._dc.getChatList(listFlags, this._query)
    const listCount = list.getCount()

    const chatList = []
    for (let i = 0; i < listCount; i++) {
      const chatId = list.getChatId(i)
      const chat = this._getChatById(chatId)

      if (!chat) continue

      if (chat.id === C.DC_CHAT_ID_DEADDROP) {
        const messageId = list.getMessageId(i)
        chat.deaddrop = this._deadDropMessage(messageId)
      }

      // This is NOT the Chat Oject, it's a smaller version for use as ChatListItem in the ChatList
      chatList.push({
        id: chat.id,
        summary: list.getSummary(i).toJson(),
        name: chat.name,
        deaddrop: chat.deaddrop,
        freshMessageCounter: chat.freshMessageCounter,
        profileImage: chat.profileImage,
        color: chat.color,
        isVerified: chat.isVerified,
        isGroup: chat.isGroup
      })
github deltachat / deltachat-desktop / src / main / deltachat / chatlist.js View on Github external
selectChat (chatId) {
    this._controller._selectedChatId = chatId
    const chat = this.getFullChatById(chatId, true)
    if (!chat) {
      log.debug(`Error: selected chat not found: ${chatId}`)
      return null
    }
    if (chat.id !== C.DC_CHAT_ID_DEADDROP && chat.freshMessageCounter > 0) {
      this._dc.markNoticedChat(chat.id)
      chat.freshMessageCounter = 0
      const messagIds = this._controller.messageList.getMessageIds(chatId)
      log.debug('markSeenMessages', messagIds)
      // TODO: move mark seen logic to frontend
      this._dc.markSeenMessages(messagIds)
      app.setBadgeCount(this._getGeneralFreshMessageCounter())
    }
    return chat
  }
github deltachat / deltachat-desktop / src / renderer / components / message / MessageWrapper.js View on Github external
const onClickContactRequest = () => openDialog('DeadDrop', { deaddrop: message })
  const onClickSetupMessage = () => openDialog('EnterAutocryptSetupMessage', { message })

  props = { ...props, onClickSetupMessage, onClickContactRequest }
  message.onForward = () => openDialog('ForwardMessage', { message })

  let body

  if (message.msg.isSetupmessage) {
    body = (
      <div>
        
      </div>
    )
  } else if (message.msg.chatId === C.DC_CHAT_ID_DEADDROP) {
    body = (
      <div>
        
      </div>
    )
  } else {
    body = 
  }

  return <li>{body}</li>
})
github deltachat / deltachat-desktop / src / main / deltachat.js View on Github external
profileImage: chat.profileImage,

      archived: chat.archived,
      subtitle: chat.subtitle,
      type: chat.type,
      isUnpromoted: chat.isUnpromoted,
      isSelfTalk: chat.isSelfTalk,

      contacts: this._dc.getChatContacts(chatId).map(id => this._dc.getContact(id).toJson()),
      totalMessages: messageIds.length,
      messages: this._messagesToRender(messageIds),
      color: this._integerToHexColor(chat.color),
      summary: undefined,
      freshMessageCounter: this._dc.getFreshMessageCount(chatId),
      isGroup: isGroupChat(chat),
      isDeaddrop: chatId === C.DC_CHAT_ID_DEADDROP,
      draft: chat.draft
    }
  }
github deltachat / deltachat-desktop / src / main / deltachat.js View on Github external
contactRequests () {
    this.selectChat(C.DC_CHAT_ID_DEADDROP)
  }
github deltachat / deltachat-desktop / src / renderer / components / Menu.js View on Github external
  const onContactRequests = () => chatStoreDispatch({ type: 'SELECT_CHAT', payload: C.DC_CHAT_ID_DEADDROP })
  const logout = () => ipcRenderer.send('logout')
github deltachat / deltachat-desktop / src / renderer / components / helpers / ChatListItem.js View on Github external
const ChatListItem = React.memo(props =&gt; {
  const { chatListItem, onClick } = props
  if (chatListItem === null) return null
  if (typeof chatListItem === 'undefined') return 
  if (chatListItem.id === C.DC_CHAT_ID_DEADDROP) return 
  if (chatListItem.id === C.DC_CHAT_ID_ARCHIVED_LINK) return 
  return 
}, (prevProps, nextProps) =&gt; {
  const shouldRerender = prevProps.chatListItem !== nextProps.chatListItem || prevProps.isSelected !== nextProps.isSelected