comparison src/conversation.c @ 4522:0738264a52ad

[gaim-migrate @ 4800] <pur-angst> faceprint: that'd be sweet <ChipX86> faceprint: you should commit that <faceprint> i should this will let you group conversations by the account committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 04 Feb 2003 23:27:40 +0000
parents f3afcc4dd133
children 06084165a966
comparison
equal deleted inserted replaced
4521:dda0fbba1c46 4522:0738264a52ad
2119 /* Make a new window. */ 2119 /* Make a new window. */
2120 conv_placement_new_window(conv); 2120 conv_placement_new_window(conv);
2121 } 2121 }
2122 } 2122 }
2123 2123
2124 /* This groups things by account. Otherwise, the same semantics as above */
2125 static void
2126 conv_placement_by_account(struct gaim_conversation *conv)
2127 {
2128 GaimConversationType type;
2129 GList *wins, *convs;
2130 struct gaim_account *account;
2131
2132
2133 account = gaim_conversation_get_account(conv);
2134 type = gaim_conversation_get_type(conv);
2135
2136
2137 /* Go through the list of IMs and find one with this group. */
2138 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) {
2139 struct gaim_window *win2;
2140 struct gaim_conversation *conv2;
2141
2142 win2 = (struct gaim_window *)wins->data;
2143
2144 for (convs = gaim_window_get_conversations(win2);
2145 convs != NULL;
2146 convs = convs->next) {
2147
2148 conv2 = (struct gaim_conversation *)convs->data;
2149
2150 if (((convo_options & OPT_CONVO_COMBINE) ||
2151 type == gaim_conversation_get_type(conv2)) &&
2152 account == gaim_conversation_get_account(conv2)) {
2153 gaim_window_add_conversation(win2, conv);
2154 return;
2155 }
2156
2157 }
2158 }
2159 /* Make a new window. */
2160 conv_placement_new_window(conv);
2161 }
2162
2124 static int 2163 static int
2125 add_conv_placement_fnc(const char *name, gaim_conv_placement_fnc fnc) 2164 add_conv_placement_fnc(const char *name, gaim_conv_placement_fnc fnc)
2126 { 2165 {
2127 struct ConvPlacementData *data; 2166 struct ConvPlacementData *data;
2128 2167
2144 conv_placement_last_created_win); 2183 conv_placement_last_created_win);
2145 add_conv_placement_fnc(_("New window"), 2184 add_conv_placement_fnc(_("New window"),
2146 conv_placement_new_window); 2185 conv_placement_new_window);
2147 add_conv_placement_fnc(_("By group"), 2186 add_conv_placement_fnc(_("By group"),
2148 conv_placement_by_group); 2187 conv_placement_by_group);
2188 add_conv_placement_fnc(_("By account"),
2189 conv_placement_by_account);
2149 } 2190 }
2150 } 2191 }
2151 2192
2152 int 2193 int
2153 gaim_conv_placement_add_fnc(const char *name, gaim_conv_placement_fnc fnc) 2194 gaim_conv_placement_add_fnc(const char *name, gaim_conv_placement_fnc fnc)