Mercurial > pidgin.yaz
comparison src/conversation.c @ 4476:62c1e5e656d0
[gaim-migrate @ 4751]
gaim_conversation_new() now takes an aim_user parameter. This should fix
the new placement grouping bugs, as the default "user" (account)
selected was the first account in the list of connections. There may be
side-effects, especially with perl plugins, but I'm not sure. Please report
anything odd that you see as a result of this.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 30 Jan 2003 18:45:50 +0000 |
parents | c43c91ecb261 |
children | fa2d74e20a89 |
comparison
equal
deleted
inserted
replaced
4475:1f3241831734 | 4476:62c1e5e656d0 |
---|---|
839 | 839 |
840 /************************************************************************** | 840 /************************************************************************** |
841 * Conversation API | 841 * Conversation API |
842 **************************************************************************/ | 842 **************************************************************************/ |
843 struct gaim_conversation * | 843 struct gaim_conversation * |
844 gaim_conversation_new(GaimConversationType type, const char *name) | 844 gaim_conversation_new(GaimConversationType type, struct aim_user *user, |
845 const char *name) | |
845 { | 846 { |
846 struct gaim_conversation *conv; | 847 struct gaim_conversation *conv; |
847 | 848 |
848 if (type == GAIM_CONV_UNKNOWN) | 849 if (type == GAIM_CONV_UNKNOWN) |
849 return NULL; | 850 return NULL; |
850 | 851 |
851 /* Check if this conversation already exists. */ | 852 /* Check if this conversation already exists. */ |
852 if ((conv = gaim_find_conversation(name)) != NULL) | 853 if ((conv = gaim_find_conversation_with_user(name, user)) != NULL) |
853 return conv; | 854 return conv; |
854 | 855 |
855 conv = g_malloc0(sizeof(struct gaim_conversation)); | 856 conv = g_malloc0(sizeof(struct gaim_conversation)); |
856 | 857 |
857 conv->type = type; | 858 conv->type = type; |
859 conv->user = user; | |
858 conv->name = g_strdup(name); | 860 conv->name = g_strdup(name); |
859 conv->title = g_strdup(name); | 861 conv->title = g_strdup(name); |
860 conv->send_history = g_list_append(NULL, NULL); | 862 conv->send_history = g_list_append(NULL, NULL); |
861 conv->history = g_string_new(""); | 863 conv->history = g_string_new(""); |
862 | 864 |
879 | 881 |
880 gaim_conversation_set_logging(conv, (logging_options & OPT_LOG_CHATS)); | 882 gaim_conversation_set_logging(conv, (logging_options & OPT_LOG_CHATS)); |
881 } | 883 } |
882 | 884 |
883 conversations = g_list_append(conversations, conv); | 885 conversations = g_list_append(conversations, conv); |
884 | |
885 /* Set the gc */ | |
886 if (connections != NULL) { | |
887 gaim_conversation_set_user(conv, | |
888 ((struct gaim_connection *)connections->data)->user); | |
889 } | |
890 | 886 |
891 /* Auto-set the title. */ | 887 /* Auto-set the title. */ |
892 gaim_conversation_autoset_title(conv); | 888 gaim_conversation_autoset_title(conv); |
893 | 889 |
894 /* | 890 /* |
1327 { | 1323 { |
1328 struct gaim_conversation *c = NULL; | 1324 struct gaim_conversation *c = NULL; |
1329 char *cuser; | 1325 char *cuser; |
1330 GList *cnv; | 1326 GList *cnv; |
1331 | 1327 |
1332 if (name == NULL || user == NULL) | 1328 if (name == NULL) |
1333 return NULL; | 1329 return NULL; |
1334 | 1330 |
1335 cuser = g_strdup(normalize(name)); | 1331 cuser = g_strdup(normalize(name)); |
1336 | 1332 |
1337 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { | 1333 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { |