1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge remote-tracking branch 'origin/muc_roles' into muc_roles

This commit is contained in:
James Booth 2014-10-02 01:38:02 +01:00
commit 41d6994310
2 changed files with 8 additions and 18 deletions

View File

@ -1077,15 +1077,11 @@ cmd_msg(gchar **args, struct cmd_help_t help)
cons_show_error("Failed to send message. Please check OTR policy"); cons_show_error("Failed to send message. Please check OTR policy");
return TRUE; return TRUE;
} else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) { } else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
char *otr_base_tag = OTRL_MESSAGE_TAG_BASE; GString *otr_message = g_string_new(msg);
char *otr_v2_tag = OTRL_MESSAGE_TAG_V2; g_string_append(otr_message, OTRL_MESSAGE_TAG_BASE);
int N = strlen(otr_base_tag) + strlen(otr_v2_tag) + strlen(msg) + 1; g_string_append(otr_message, OTRL_MESSAGE_TAG_V2);
char *temp = (char *) malloc( (unsigned) N*sizeof(char *) ); message_send(otr_message->str, usr_jid);
strcpy( temp , msg ); g_string_free(otr_message, TRUE);
strcat( temp , otr_base_tag);
strcat( temp, otr_v2_tag);
message_send(temp, usr_jid);
free(temp);
} else { } else {
message_send(msg, usr_jid); message_send(msg, usr_jid);
} }

View File

@ -87,15 +87,9 @@ buffer_push(ProfBuff buffer, const char show_char, const char * const date_fmt,
e->show_char = show_char; e->show_char = show_char;
e->flags = flags; e->flags = flags;
e->attrs = attrs; e->attrs = attrs;
e->date_fmt = strdup(date_fmt);
e->date_fmt = malloc(strlen(date_fmt)+1); e->from = strdup(from);
strcpy(e->date_fmt, date_fmt); e->message = strdup(message);
e->from = malloc(strlen(from)+1);
strcpy(e->from, from);
e->message = malloc(strlen(message)+1);
strcpy(e->message, message);
if (g_slist_length(buffer->entries) == BUFF_SIZE) { if (g_slist_length(buffer->entries) == BUFF_SIZE) {
_free_entry(buffer->entries->data); _free_entry(buffer->entries->data);