comparison src/conversation.c @ 4382:76223649765b

[gaim-migrate @ 4648] Raise window on events works again. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 22 Jan 2003 01:26:46 +0000
parents 194507c83612
children c90039137172
comparison
equal deleted inserted replaced
4381:af485b4bb8c1 4382:76223649765b
1544 GAIM_CONV_UPDATE_TYPING); 1544 GAIM_CONV_UPDATE_TYPING);
1545 } 1545 }
1546 1546
1547 void 1547 void
1548 gaim_im_write(struct gaim_im *im, const char *who, const char *message, 1548 gaim_im_write(struct gaim_im *im, const char *who, const char *message,
1549 size_t len, int flag, time_t mtime) 1549 size_t len, int flags, time_t mtime)
1550 { 1550 {
1551 struct gaim_conversation *c; 1551 struct gaim_conversation *c;
1552 1552
1553 if (im == NULL || message == NULL) 1553 if (im == NULL || message == NULL)
1554 return; 1554 return;
1555 1555
1556 c = gaim_im_get_conversation(im); 1556 c = gaim_im_get_conversation(im);
1557 1557
1558 /* Raise the window, if specified in prefs. */
1559 if (!(flags & WFLAG_NOLOG) & (im_options & OPT_IM_POPUP))
1560 gaim_window_raise(gaim_conversation_get_window(c));
1561
1558 if (c->ops != NULL && c->ops->write_im != NULL) 1562 if (c->ops != NULL && c->ops->write_im != NULL)
1559 c->ops->write_im(c, who, message, len, flag, mtime); 1563 c->ops->write_im(c, who, message, len, flags, mtime);
1560 else 1564 else
1561 gaim_conversation_write(c, who, message, -1, flag, mtime); 1565 gaim_conversation_write(c, who, message, -1, flags, mtime);
1562 } 1566 }
1563 1567
1564 void 1568 void
1565 gaim_im_send(struct gaim_im *im, const char *message) 1569 gaim_im_send(struct gaim_im *im, const char *message)
1566 { 1570 {
1741 return chat->id; 1745 return chat->id;
1742 } 1746 }
1743 1747
1744 void 1748 void
1745 gaim_chat_write(struct gaim_chat *chat, const char *who, 1749 gaim_chat_write(struct gaim_chat *chat, const char *who,
1746 const char *message, int flag, time_t mtime) 1750 const char *message, int flags, time_t mtime)
1747 { 1751 {
1748 struct gaim_conversation *conv; 1752 struct gaim_conversation *conv;
1749 struct gaim_connection *gc; 1753 struct gaim_connection *gc;
1750 1754
1751 if (chat == NULL || who == NULL || message == NULL) 1755 if (chat == NULL || who == NULL || message == NULL)
1756 1760
1757 /* Don't display this if the person who wrote it is ignored. */ 1761 /* Don't display this if the person who wrote it is ignored. */
1758 if (gaim_chat_is_user_ignored(chat, who)) 1762 if (gaim_chat_is_user_ignored(chat, who))
1759 return; 1763 return;
1760 1764
1761 if (!(flag & WFLAG_WHISPER)) { 1765 /* Raise the window, if specified in prefs. */
1766 if (!(flags & WFLAG_NOLOG) & (chat_options & OPT_CHAT_POPUP))
1767 gaim_window_raise(gaim_conversation_get_window(conv));
1768
1769 if (!(flags & WFLAG_WHISPER)) {
1762 char *str; 1770 char *str;
1763 1771
1764 str = g_strdup(normalize(who)); 1772 str = g_strdup(normalize(who));
1765 1773
1766 if (!g_strcasecmp(str, normalize(gc->username)) || 1774 if (!g_strcasecmp(str, normalize(gc->username)) ||
1767 !g_strcasecmp(str, normalize(gc->displayname))) { 1775 !g_strcasecmp(str, normalize(gc->displayname))) {
1768 1776
1769 flag |= WFLAG_SEND; 1777 flags |= WFLAG_SEND;
1770 } 1778 }
1771 else { 1779 else {
1772 flag |= WFLAG_RECV; 1780 flags |= WFLAG_RECV;
1773 1781
1774 if (find_nick(gc, message)) 1782 if (find_nick(gc, message))
1775 flag |= WFLAG_NICK; 1783 flags |= WFLAG_NICK;
1776 } 1784 }
1777 1785
1778 g_free(str); 1786 g_free(str);
1779 } 1787 }
1780 1788
1781 /* Pass this on to either the ops structure or the default write func. */ 1789 /* Pass this on to either the ops structure or the default write func. */
1782 if (conv->ops != NULL && conv->ops->write_chat != NULL) 1790 if (conv->ops != NULL && conv->ops->write_chat != NULL)
1783 conv->ops->write_chat(conv, who, message, flag, mtime); 1791 conv->ops->write_chat(conv, who, message, flags, mtime);
1784 else 1792 else
1785 gaim_conversation_write(conv, who, message, -1, flag, mtime); 1793 gaim_conversation_write(conv, who, message, -1, flags, mtime);
1786 } 1794 }
1787 1795
1788 void 1796 void
1789 gaim_chat_send(struct gaim_chat *chat, const char *message) 1797 gaim_chat_send(struct gaim_chat *chat, const char *message)
1790 { 1798 {