Changeset 0864a52
- Timestamp:
- 2015-05-28T05:26:30Z (9 years ago)
- Branches:
- master
- Children:
- b38f655
- Parents:
- faeb521
- git-author:
- dequis <dx@…> (08-05-15 04:16:37)
- git-committer:
- dequis <dx@…> (28-05-15 05:26:30)
- Location:
- protocols
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee.h
rfaeb521 r0864a52 156 156 G_MODULE_EXPORT void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, guint32 flags, 157 157 time_t sent_at); 158 G_MODULE_EXPORT void imcb_notify_email(struct im_connection *ic, const char *handle, char *msg, guint32 flags, 159 time_t sent_at); 158 G_MODULE_EXPORT void imcb_notify_email(struct im_connection *ic, char *format, ...) G_GNUC_PRINTF(2, 3); 160 159 161 160 /* bee_chat.c */ -
protocols/bee_user.c
rfaeb521 r0864a52 271 271 } 272 272 273 void imcb_notify_email(struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at) 274 { 273 void imcb_notify_email(struct im_connection *ic, char *format, ...) 274 { 275 const char *handle; 276 va_list params; 277 char *msg; 278 279 if (!set_getbool(&ic->acc->set, "mail_notifications")) { 280 return; 281 } 282 283 va_start(params, format); 284 msg = g_strdup_vprintf(format, params); 285 va_end(params); 286 287 /* up to the protocol to set_add this if they want to use this */ 288 handle = set_getstr(&ic->acc->set, "notify_handle"); 289 275 290 if (handle != NULL) { 276 imcb_buddy_msg(ic, handle, msg, flags, sent_at);291 imcb_buddy_msg(ic, handle, msg, 0, 0); 277 292 } else { 278 293 imcb_log(ic, "%s", msg); 279 294 } 295 296 g_free(msg); 280 297 } 281 298 -
protocols/jabber/iq.c
rfaeb521 r0864a52 810 810 char *subject = "<no subject>"; 811 811 char *sender = "<no sender>"; 812 char *msg = NULL;813 812 guint64 t_time; 814 813 … … 828 827 } 829 828 830 msg = g_strdup_printf("New mail from %s: %s", sender, subject); 831 832 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); 829 imcb_notify_email(ic, "New mail from %s: %s", sender, subject); 833 830 834 831 c = c->next; 835 g_free(msg);836 832 } 837 833 -
protocols/msn/ns.c
rfaeb521 r0864a52 394 394 395 395 if (inbox && folders) { 396 char *msg = g_strdup_printf(396 imcb_notify_email(ic, 397 397 "INBOX contains %s new messages, plus %s messages in other folders.", inbox, 398 398 folders); 399 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0);400 g_free(msg);401 399 } 402 400 … … 410 408 411 409 if (from && fromname) { 412 char *msg = g_strdup_printf("Received an e-mail message from %s <%s>.", 413 fromname, from); 414 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); 415 g_free(msg); 410 imcb_notify_email(ic, "Received an e-mail message from %s <%s>.", fromname, from); 416 411 } 417 412 -
protocols/purple/purple.c
rfaeb521 r0864a52 1261 1261 { 1262 1262 struct im_connection *ic = purple_ic_by_gc(gc); 1263 char *msg = g_strdup_printf("Received e-mail from %s for %s: %s <%s>", from, to, subject, url); 1264 1265 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); 1266 g_free(msg); 1263 1264 imcb_notify_email(ic, "Received e-mail from %s for %s: %s <%s>", from, to, subject, url); 1267 1265 1268 1266 return NULL; -
protocols/yahoo/yahoo.c
rfaeb521 r0864a52 959 959 { 960 960 struct im_connection *ic = byahoo_get_ic_by_id(id); 961 char *msg; 962 963 if (set_getbool(&ic->acc->set, "mail_notifications")) { 964 if (from && subj) { 965 msg = g_strdup_printf("Received e-mail message from %s with subject `%s'", from, subj); 966 } else if (cnt > 0) { 967 msg = g_strdup_printf("Received %d new e-mails", cnt); 968 } 969 970 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); 971 g_free(msg); 961 962 if (from && subj) { 963 imcb_notify_email(ic, "Received e-mail message from %s with subject `%s'", from, subj); 964 } else if (cnt > 0) { 965 imcb_notify_email(ic, "Received %d new e-mails", cnt); 972 966 } 973 967 }
Note: See TracChangeset
for help on using the changeset viewer.