Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed May 2, 2020
1 parent 654c5d0 commit ffc56ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ void notify(const char *subtitle, const char *format, ...)
{
va_list args;
va_start(args, format);

CFStringRef format_ref = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
CFStringRef subtitle_ref = CFStringCreateWithCString(NULL, subtitle, kCFStringEncodingUTF8);
CFStringRef message_ref = CFStringCreateWithFormatAndArguments(NULL, NULL, format_ref, args);
va_end(args);

void *center = objc_msgSend((void *) objc_getClass("NSUserNotificationCenter"), sel_registerName("defaultUserNotificationCenter"));
void *notification = objc_msgSend((void *) objc_getClass("NSUserNotification"), sel_registerName("alloc"), sel_registerName("init"));
Expand All @@ -26,4 +26,6 @@ void notify(const char *subtitle, const char *format, ...)
CFRelease(message_ref);
CFRelease(subtitle_ref);
CFRelease(format_ref);

va_end(args);
}

0 comments on commit ffc56ca

Please sign in to comment.