Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 1305:9bc68473f8a3
-n and -f flags to message-sending commands
Allows sending normal and headline messages
author | Michal 'vorner' Vaner <vorner@ucw.cz> |
---|---|
date | Sat, 08 Sep 2007 13:21:07 +0200 |
parents | 8ada97e5eb75 |
children | a7d21918234c |
comparison
equal
deleted
inserted
replaced
1304:8ada97e5eb75 | 1305:9bc68473f8a3 |
---|---|
555 // jb_send_msg(jid, text, type, subject, msgid, *encrypted) | 555 // jb_send_msg(jid, text, type, subject, msgid, *encrypted) |
556 // When encrypted is not NULL, the function set *encrypted to 1 if the | 556 // When encrypted is not NULL, the function set *encrypted to 1 if the |
557 // message has been PGP-encrypted. If encryption enforcement is set and | 557 // message has been PGP-encrypted. If encryption enforcement is set and |
558 // encryption fails, *encrypted is set to -1. | 558 // encryption fails, *encrypted is set to -1. |
559 void jb_send_msg(const char *fjid, const char *text, int type, | 559 void jb_send_msg(const char *fjid, const char *text, int type, |
560 const char *subject, const char *msgid, gint *encrypted) | 560 const char *subject, const char *msgid, gint *encrypted, |
561 const char *type_overwrite) | |
561 { | 562 { |
562 xmlnode x; | 563 xmlnode x; |
563 gchar *strtype; | 564 const gchar *strtype; |
564 #ifdef HAVE_LIBOTR | 565 #ifdef HAVE_LIBOTR |
565 int otr_msg = 0; | 566 int otr_msg = 0; |
566 #endif | 567 #endif |
567 #if defined HAVE_GPGME || defined JEP0022 || defined JEP0085 | 568 #if defined HAVE_GPGME || defined JEP0022 || defined JEP0085 |
568 char *rname, *barejid; | 569 char *rname, *barejid; |
581 if (encrypted) | 582 if (encrypted) |
582 *encrypted = 0; | 583 *encrypted = 0; |
583 | 584 |
584 if (!online) return; | 585 if (!online) return; |
585 | 586 |
586 if (type == ROSTER_TYPE_ROOM) | 587 if (type_overwrite) |
587 strtype = TMSG_GROUPCHAT; | 588 strtype = type_overwrite; |
588 else | 589 else { |
589 strtype = TMSG_CHAT; | 590 if (type == ROSTER_TYPE_ROOM) |
591 strtype = TMSG_GROUPCHAT; | |
592 else | |
593 strtype = TMSG_CHAT; | |
594 } | |
590 | 595 |
591 #if defined HAVE_GPGME || defined HAVE_LIBOTR || defined JEP0022 || defined JEP0085 | 596 #if defined HAVE_GPGME || defined HAVE_LIBOTR || defined JEP0022 || defined JEP0085 |
592 rname = strchr(fjid, JID_RESOURCE_SEPARATOR); | 597 rname = strchr(fjid, JID_RESOURCE_SEPARATOR); |
593 barejid = jidtodisp(fjid); | 598 barejid = jidtodisp(fjid); |
594 sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); | 599 sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); |