text stringlengths 0 357 |
|---|
} |
} |
else if (command==DC_CMD_MEMBER_ADDED_TO_GROUP) |
{ |
do_gossip = 1; |
char* email_to_add = dc_param_get(msg->param, DC_PARAM_CMD_ARG, NULL); |
if (email_to_add) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Group-Member-Added"), email_to_add)); |
grpimage = dc_param_get(chat->param, DC_PARAM_PROFILE_IMAGE, NULL); |
} |
if (dc_param_get_int(msg->param, DC_PARAM_CMD_ARG2, 0)&DC_FROM_HANDSHAKE) { |
dc_log_info(msg->context, 0, "sending secure-join message '%s' >>>>>>>>>>>>>>>>>>>>>>>>>", "vg-member-added"); |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Secure-Join"), strdup("vg-member-added"))); |
} |
} |
else if (command==DC_CMD_GROUPNAME_CHANGED) |
{ |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Group-Name-Changed"), dc_param_get(msg->param, DC_PARAM_CMD_ARG, ""))); |
} |
else if (command==DC_CMD_GROUPIMAGE_CHANGED) |
{ |
grpimage = dc_param_get(msg->param, DC_PARAM_CMD_ARG, NULL); |
if (grpimage==NULL) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Group-Image"), dc_strdup("0"))); |
} |
} |
} |
if (command==DC_CMD_LOCATION_STREAMING_ENABLED) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom( |
strdup("Chat-Content"), |
strdup("location-streaming-enabled"))); |
} |
if (command==DC_CMD_AUTOCRYPT_SETUP_MESSAGE) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Autocrypt-Setup-Message"), strdup("v1"))); |
placeholdertext = dc_stock_str(factory->context, DC_STR_AC_SETUP_MSG_BODY); |
} |
if (command==DC_CMD_SECUREJOIN_MESSAGE) { |
char* step = dc_param_get(msg->param, DC_PARAM_CMD_ARG, NULL); |
if (step) { |
dc_log_info(msg->context, 0, "sending secure-join message '%s' >>>>>>>>>>>>>>>>>>>>>>>>>", step); |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Secure-Join"), step/*mailimf takes ownership of string*/)); |
char* param2 = dc_param_get(msg->param, DC_PARAM_CMD_ARG2, NULL); |
if (param2) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom( |
(strcmp(step, "vg-request-with-auth")==0 || strcmp(step, "vc-request-with-auth")==0)? |
strdup("Secure-Join-Auth") : strdup("Secure-Join-Invitenumber"), |
param2/*mailimf takes ownership of string*/)); |
} |
char* fingerprint = dc_param_get(msg->param, DC_PARAM_CMD_ARG3, NULL); |
if (fingerprint) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom( |
strdup("Secure-Join-Fingerprint"), |
fingerprint/*mailimf takes ownership of string*/)); |
} |
char* grpid = dc_param_get(msg->param, DC_PARAM_CMD_ARG4, NULL); |
if (grpid) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom( |
strdup("Secure-Join-Group"), |
grpid/*mailimf takes ownership of string*/)); |
} |
} |
} |
if (grpimage) |
{ |
dc_msg_t* meta = dc_msg_new_untyped(factory->context); |
meta->type = DC_MSG_IMAGE; |
dc_param_set(meta->param, DC_PARAM_FILE, grpimage); |
char* filename_as_sent = NULL; |
if ((meta_part=build_body_file(meta, "group-image", &filename_as_sent))!=NULL) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Group-Image"), filename_as_sent/*takes ownership*/)); |
} |
dc_msg_unref(meta); |
} |
if (msg->type==DC_MSG_VOICE || msg->type==DC_MSG_AUDIO || msg->type==DC_MSG_VIDEO) |
{ |
if (msg->type==DC_MSG_VOICE) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Voice-Message"), strdup("1"))); |
} |
int duration_ms = dc_param_get_int(msg->param, DC_PARAM_DURATION, 0); |
if (duration_ms > 0) { |
mailimf_fields_add(imf_fields, mailimf_field_new_custom(strdup("Chat-Duration"), dc_mprintf("%i", (int)duration_ms))); |
} |
} |
/* add text part - we even add empty text and force a MIME-multipart-message as: |
- some Apps have problems with Non-text in the main part (eg. "Mail" from stock Android) |
- we can add "forward hints" this way |
- it looks better */ |
afwd_email = dc_param_exists(msg->param, DC_PARAM_FORWARDED); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.