+ /* Auto-retract and decline pending notices */
+ /* Notices are sent after mutex unlock */
+ for (i = 0; i < server->num_invites; i++)
+ {
+ invite = server->invites[i];
+ if ((invite->actor == client) || (invite->invitee == client))
+ {
+ send_notice = TRUE;
+ if (invite->actor == client)
+ xasprintf (¬ice, "%s" "NOTICE RETRACT %s %s\r\n",
+ notice,
+ ttt_client_get_username(invite->actor),
+ ttt_client_get_username(invite->invitee));
+ else
+ xasprintf (¬ice, "%s" "NOTICE DECLINE %s %s\r\n",
+ notice,
+ ttt_client_get_username(invite->invitee),
+ ttt_client_get_username(invite->actor));
+
+ memmove (&server->invites[i], &server->invites[i+1],
+ (server->num_invites - i - 1) * sizeof (ttt_invite_t *));
+ server->num_invites--;
+ i--;
+ }
+ }
+