Add the destination information of this person to the message.
325058
public TrxMessageHeader addDestInfo(TrxMessageHeader trxMessageHeader)
    {
        String strMessageTransport = (String)trxMessageHeader.get(MessageTransportModel.SEND_MESSAGE_BY_PARAM);
        if ((MessageTransportModel.EMAIL.equalsIgnoreCase(strMessageTransport))
            && (trxMessageHeader.get(TrxMessageHeader.DESTINATION_PARAM) == null))
                trxMessageHeader.put(TrxMessageHeader.DESTINATION_PARAM, this.getField(Person.EMAIL).toString());
        else if ((MessageTransportModel.FAX.equalsIgnoreCase(strMessageTransport))
            && (trxMessageHeader.get(TrxMessageHeader.DESTINATION_PARAM) == null))
                trxMessageHeader.put(TrxMessageHeader.DESTINATION_PARAM, this.getField(Person.FAX).toString());
        else if ((MessageTransportModel.MAIL.equalsIgnoreCase(strMessageTransport))
            && (trxMessageHeader.get(TrxMessageHeader.DESTINATION_PARAM) == null))
        {
            String strMail = this.getField(Person.NAME).toString();
            strMail += '\n' + this.getField(Person.ADDRESS_LINE_1).toString();
            if (!this.getField(Person.ADDRESS_LINE_2).isNull())
                strMail += '\n' + this.getField(Person.ADDRESS_LINE_2).toString();
            strMail += '\n' + this.getField(Person.CITY_OR_TOWN).toString();
            if (!this.getField(Person.STATE_OR_REGION).isNull())
                strMail += ", " + this.getField(Person.STATE_OR_REGION).toString();
            if (!this.getField(Person.POSTAL_CODE).isNull())
                strMail += ' ' + this.getField(Person.POSTAL_CODE).toString();
            if (!this.getField(Person.COUNTRY).isNull())
                strMail += ' ' + this.getField(Person.COUNTRY).toString();
            trxMessageHeader.put(TrxMessageHeader.DESTINATION_PARAM, strMail);
        }
        Map<String,Object> mapInfo = trxMessageHeader.getMessageInfoMap();
        if (mapInfo == null)
            trxMessageHeader.setMessageInfoMap(mapInfo = new HashMap<String,Object>());
        
        mapInfo.put(TrxMessageHeader.CONTACT_TYPE, this.getTableNames(false));
        mapInfo.put(TrxMessageHeader.CONTACT_ID, this.getField(Person.ID).toString());
        if (!this.getField(Person.USER_ID).isNull())
        {
            mapInfo.put(TrxMessageHeader.CONTACT_USER_ID, this.getField(Person.USER_ID).toString());
            Record recUserInfo = ((ReferenceField)this.getField(Person.USER_ID)).getReference();
            if (recUserInfo != null)
                if ((recUserInfo.getEditMode() == DBConstants.EDIT_CURRENT) || (recUserInfo.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
                    if (!recUserInfo.getField(UserInfo.USER_NAME).isNull())
                        mapInfo.put(TrxMessageHeader.CONTACT_USER, recUserInfo.getField(UserInfo.USER_NAME).toString());
        }
        
        return trxMessageHeader;
    }
1310789
function message(msg, rinfo) {
    self.emit('data', msg.toString().replace(/\n$/, ''), {
      port: rinfo.port,
      host: rinfo.address
    },
    rinfo.family.toLowerCase());
  }
624558
public void displayNewIncomingMessageItem(ApptentiveMessage message) {
		messagingActionHandler.sendEmptyMessage(MSG_REMOVE_STATUS);
		// Determine where to insert the new incoming message. It will be in front of any eidting
		// area, i.e. composing, Who Card ...
		int insertIndex = listItems.size(); // If inserted onto the end, then the list will have grown by one.

		outside_loop:
		// Starting at end of list, go back up the list to find the proper place to insert the incoming message.
		for (int i = listItems.size() - 1; i > 0; i--) {
			MessageCenterListItem item = listItems.get(i);
			switch (item.getListItemType()) {
				case MESSAGE_COMPOSER:
				case MESSAGE_CONTEXT:
				case WHO_CARD:
				case STATUS:
					insertIndex--;
					break;
				default:
					// Any other type means we are past the temporary items.
					break outside_loop;
			}
		}
		listItems.add(insertIndex, message);
		messageCenterRecyclerViewAdapter.notifyItemInserted(insertIndex);

		int firstIndex = messageCenterRecyclerView.getFirstVisiblePosition();
		int lastIndex = messageCenterRecyclerView.getLastVisiblePosition();
		boolean composingAreaTakesUpVisibleArea = firstIndex <= insertIndex && insertIndex < lastIndex;
		if (composingAreaTakesUpVisibleArea) {
			View v = messageCenterRecyclerView.getChildAt(0);
			int top = (v == null) ? 0 : v.getTop();
			updateMessageSentStates();
			// Restore the position of listview to composing view
			messagingActionHandler.sendMessage(messagingActionHandler.obtainMessage(MSG_SCROLL_FROM_TOP, insertIndex, top));
		} else {
			updateMessageSentStates();
		}
	}
737025
def addNotice(self, data):
        
        LOGGER.info('Sending addnotice to Polyglot: {}'.format(data))
        message = { 'addnotice': data }
        self.send(message)
542100
def _add_notification(self, message):
        
        sess = cherrypy.session
        username = sess.get(SESSION_KEY, None)
        if username not in self.notifications:
            self.notifications[username] = []
        self.notifications[username].append(message)
1058837
def add_recipient(data)
      channel_id = data['channel_id'].to_i
      channel = self.channel(channel_id)

      recipient_user = ensure_user(data['user'])
      recipient = Recipient.new(recipient_user, channel, self)
      channel.add_recipient(recipient)
    end
23889
def reply(self, messageId, *messageParts):
        
        routingInfo = self._routingInfo.pop(messageId)
        self.send(routingInfo + [messageId, b''] + list(messageParts))
57777
def info(request, message, extra_tags='', fail_silently=False, async=False):
    """"""
    if ASYNC and async:
        messages.info(_get_user(request), message)
    else:
        add_message(request, constants.INFO, message, extra_tags=extra_tags,
                    fail_silently=fail_silently)
294162
public void setBasicTraceDetail(SIDestinationAddress destinationAddress, 
                                  DestinationType destinationType,
                                  SIBusMessage message)
  {
    if (destinationAddress == null)
    {
      validateAndPutProperty("BusName", "");
      validateAndPutProperty("DestinationName", "");
    }
    else
    {
      validateAndPutProperty("BusName", destinationAddress.getBusName());
      validateAndPutProperty("DestinationName", destinationAddress.getDestinationName());
    }
    
    validateAndPutProperty("DestinationType", destinationType);
    
    if (message == null)
    {
      validateAndPutProperty("SystemMessageID", "");
      validateAndPutProperty("Priority", "");
      validateAndPutProperty("Reliability", "");
      validateAndPutProperty("Discriminator","");
    }
    else
    {
      validateAndPutProperty("SystemMessageID", message.getSystemMessageId());
      validateAndPutProperty("Priority", message.getPriority());
      validateAndPutProperty("Reliability", message.getReliability());
      validateAndPutProperty("Discriminator",message.getDiscriminator());
    }
  }
173758
def create(cls, destination):
        """"""
        mdb_gz_b64 = """\
        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
        """
        pristine = StringIO()
        pristine.write(base64.b64decode(mdb_gz_b64))
        pristine.seek(0)
        pristine = gzip.GzipFile(fileobj=pristine, mode='rb')
        with open(destination, 'wb') as handle: shutil.copyfileobj(pristine, handle)
        return cls(destination)
727316
def _on_add_route(self, msg):
        
        if msg.is_dead:
            return

        target_id_s, _, target_name = bytes_partition(msg.data, b(':'))
        target_name = target_name.decode()
        target_id = int(target_id_s)
        self.router.context_by_id(target_id).name = target_name
        stream = self.router.stream_by_id(msg.auth_id)
        current = self.router.stream_by_id(target_id)
        if current and current.remote_id != mitogen.parent_id:
            LOG.error('Cannot add duplicate route to %r via %r, '
                      'already have existing route via %r',
                      target_id, stream, current)
            return

        LOG.debug('Adding route to %d via %r', target_id, stream)
        self._routes_by_stream[stream].add(target_id)
        self.router.add_route(target_id, stream)
        self._propagate_up(mitogen.core.ADD_ROUTE, target_id, target_name)
1027155
def add_sender_info( self, sender_txhash, nulldata_vin_outpoint, sender_out_data ):
        
        assert sender_txhash in self.sender_info.keys(), "Missing sender info for %s" % sender_txhash
        assert nulldata_vin_outpoint in self.sender_info[sender_txhash], "Missing outpoint %s for sender %s" % (nulldata_vin_outpoint, sender_txhash)

        block_hash = self.sender_info[sender_txhash][nulldata_vin_outpoint]['block_hash']
        relindex = self.sender_info[sender_txhash][nulldata_vin_outpoint]['relindex']
        relinput_index = self.sender_info[sender_txhash][nulldata_vin_outpoint]['relinput']

        value_in_satoshis = sender_out_data['value']
        script_pubkey = sender_out_data['script']
        script_info = bits.btc_tx_output_parse_script(script_pubkey)
        script_type = script_info['type']
        addresses = script_info.get('addresses', [])
        
        sender_info = {
            "value": value_in_satoshis,
            "script_pubkey": script_pubkey,
            "script_type": script_type,
            "addresses": addresses,
            "nulldata_vin_outpoint": nulldata_vin_outpoint,
            "txid": sender_txhash,
        }
        
        # debit this tx's total value
        self.block_info[block_hash]['txns'][relindex]['fee'] += value_in_satoshis

        # remember this sender, but put it in the right place.
        # senders[i] must correspond to tx['vin'][i]
        self.block_info[block_hash]['txns'][relindex]['senders'][relinput_index] = sender_info
        self.block_info[block_hash]['num_senders'] += 1

        return True
998456
async def say(self, body, user, options):
        
        return await self.send_text_message_to_all_interfaces(
            recipient=user, text=body, options=options)
27820
def AddAsMessage(self, rdfvalue_in, source, mutation_pool=None):
    """"""
    self.Add(
        rdf_flows.GrrMessage(payload=rdfvalue_in, source=source),
        mutation_pool=mutation_pool)
58660
def send(self, message):
        
        message.update(self._globalFields)
        errors = []
        for dest in self._destinations:
            try:
                dest(message)
            except:
                errors.append(sys.exc_info())
        if errors:
            raise _DestinationsSendError(errors)
687780
public void addMessage(String key, String value) {

        if (m_bundleMap != null) {
            m_bundleMap.put(key, value);
        }
    }
1270070
def add_message(self, text, type=None):
        """"""
        key = self._msg_key
        self.setdefault(key, [])
        self[key].append(message(type, text))
        self.save()