Commit 9ffc6675 authored by Matthias Larisch's avatar Matthias Larisch

Conversations now have NULL default name

Migrate old data as well.
parent a768fb20
Pipeline #8474875 passed with stage
in 3 minutes and 24 seconds
......@@ -490,7 +490,7 @@ var msg = {
}
str_title = data.conversation.name;
if(str_title == '')
if(str_title === null)
{
str_title = 'Unterhaltung mit ' + names.join(', ');
}
......@@ -703,4 +703,4 @@ var msg = {
$(function(){
msg.init();
});
\ No newline at end of file
});
......@@ -79,7 +79,7 @@ class MsgView extends View
$title .= ', '.$m['name'];
}
if($c['name'] == '')
if(is_null($c['name']))
{
$title = substr($title, 2);
}
......
......@@ -421,7 +421,7 @@ var conv = {
*/
title = ret.conversation.name;
if(ret.conversation.name == '')
if(ret.conversation.name === null)
{
title = new Array();
for(var i=0;i<ret.member.length;i++)
......@@ -533,4 +533,4 @@ $(function(){
{
conv.init();
}
});
\ No newline at end of file
});
......@@ -548,7 +548,7 @@ return tmp;},settings:function(cid)
{conv.chatboxes[key].last_mid=parseInt(message.id);conv.chatboxes[key].el.children('.slimScrollDiv').children('.chatboxcontent').append('<div title="'+message.time+'" class="chatboxmessage"><span class="chatboxmessagefrom"><a href="#" class="photo" onclick="profile('+message.fs_id+');return false;"><img src="'+conv.img(message.fs_photo+'','mini')+'"></a></span><span class="chatboxmessagecontent">'+nl2br(message.body.autoLink())+'<span class="time">'+timeformat.nice(message.time)+'</span></span><div style="clear:both;"></div></div>');},initChat:function(cid)
{conv.showLoader(cid);var key=this.getKey(cid);var cid=cid;ajax.req('msg','loadconversation',{loader:false,data:{id:cid},success:function(ret){if(ret.member.length>2)
{conv.addChatOption(cid,'<a href="#" onclick="if(confirm(\'Bist Du Dir Sicher das Du den Chat verlassen möchtest?\')){ajax.req(\'msg\',\'leave\',{data:{cid:'+cid+'}});}return false;">Chat verlassen</a>');conv.addChatOption(cid,'<span class="optinput"><input placeholder="Chat umbenennen..." type="text" name="chatname" value="" maxlength="30" /><i onclick="var val=$(this).prev().val();ajax.req(\'msg\',\'rename\',{data:{cid:'+cid+',name:val}});return false;" class="fa fa-arrow-circle-right"></i></span>');}
title=ret.conversation.name;if(ret.conversation.name=='')
title=ret.conversation.name;if(ret.conversation.name===null)
{title=new Array();for(var i=0;i<ret.member.length;i++)
{if(ret.member[i]!=undefined&&ret.member[i].id!=user.id)
{title.push(ret.member[i].name);}}
......
......@@ -221,3 +221,5 @@ ALTER TABLE fs_usernotes_has_wallpost ADD CONSTRAINT FOREIGN KEY (wallpost_id) R
RENAME TABLE fs_foodsaver_archive TO fs_foodsaver_archive4;
CREATE TABLE fs_foodsaver_archive LIKE fs_foodsaver;
UPDATE fs_conversation SET `name` = NULL WHERE `name` = '';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment