_Bool messages_mup(MESSAGES *m){ if(m->iover != MSG_IDX_MAX) { MESSAGE *msg = m->data->data[m->iover]; if(msg->msg_type == MSG_TYPE_TEXT){ if(m->urlover != STRING_IDX_MAX && m->urlmdown) { char_t url[m->urllen + 1]; memcpy(url, msg->msg + m->urlover, m->urllen * sizeof(char_t)); url[m->urllen] = 0; openurl(url); m->urlmdown = 0; } } } //temporary, change this if(m->select) { char_t *lel = malloc(65536); //TODO: De-hardcode this value. setselection(lel, messages_selection(m, lel, 65536, 0)); free(lel); m->select = 0; } m->idown = MSG_IDX_MAX; return 0; }
static void saveprimary(void) { int len; if(!selection_src) { len = edit_selection(selection_p, primary.data, sizeof(primary.data)); } else if(selection_src == 1) { len = messages_selection(selection_p, primary.data, sizeof(primary.data)); } else { memcpy(primary.data, self.id, sizeof(self.id)); len = sizeof(self.id); } if(len) { primary.len = len; } }