Browse Source
Add a MAMEarliest table to keep track of the earliest message when requesting MAM
Add a MAMEarliest table to keep track of the earliest message when requesting MAM
Get MAM when MAMEarliest is not therepull/1456/head
7 changed files with 149 additions and 23 deletions
-
1CHANGELOG.md
-
17app/MAMEarliest.php
-
5app/User.php
-
78app/Widgets/Chat/Chat.php
-
5app/Widgets/Chats/Chats.php
-
31database/migrations/20250801115140_create_m_a_m_earliest_table.php
-
35src/Moxl/Xec/Action/MAM/Get.php
@ -0,0 +1,17 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App; |
||||
|
|
||||
|
use Awobaz\Compoships\Database\Eloquent\Model; |
||||
|
|
||||
|
class MAMEarliest extends Model |
||||
|
{ |
||||
|
protected $table = 'mam_earliest'; |
||||
|
|
||||
|
use \Awobaz\Compoships\Compoships; |
||||
|
|
||||
|
public function user() |
||||
|
{ |
||||
|
return $this->belongsTo('App\User'); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use Movim\Migration; |
||||
|
use Illuminate\Database\Schema\Blueprint; |
||||
|
|
||||
|
class CreateMAMEarliestTable extends Migration |
||||
|
{ |
||||
|
public function up() |
||||
|
{ |
||||
|
$this->schema->create('mam_earliest', function (Blueprint $table) { |
||||
|
$table->increments('id'); |
||||
|
|
||||
|
$table->string('user_id'); |
||||
|
$table->string('to')->nullable(); |
||||
|
$table->string('jid')->nullable(); |
||||
|
$table->dateTime('earliest'); |
||||
|
|
||||
|
$table->foreign('user_id')->references('id') |
||||
|
->on('users')->onDelete('cascade'); |
||||
|
|
||||
|
$table->timestamps(); |
||||
|
|
||||
|
$table->unique(['user_id', 'to', 'jid']); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
public function down() |
||||
|
{ |
||||
|
$this->schema->drop('mam_earliest'); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue